ibm-js / dtreemap Goto Github PK
View Code? Open in Web Editor NEWTreeMap Custom Element
License: Other
TreeMap Custom Element
License: Other
this comes from the fact that we have elements twice: once in the animated element and once outside. Unfortunately we relayout the non animated elements.
Waiting for dojo/gesture discussions to finish before doing this (so that I don't do it twice)
This would allow to increase performances when re-creating the treemap hierarchy (but does it really worth it?, not sure)
dtreemap
is not repositioned when DOM is changed. It could be only a CSS issue.
Below is an example that illustrates it.
To reproduce this:
require(["dojo/ready", "dojo/dom", "dojox/treemap/TreeMap",
"dojo/store/Memory", "dojox/color/MeanColorModel", "dojo/_base/Color"],
function(ready, dom, TreeMap, Memory, MeanColorModel, Color) {
ready(function(){
// example from documentation
var dataStore = new Memory({idProperty: "label", data:
[
{ label: "France", sales: 500, profit: 50, region: "EU" },
{ label: "Germany", sales: 450, profit: 48, region: "EU" },
{ label: "UK", sales: 700, profit: 60, region: "EU" },
{ label: "USA", sales: 2000, profit: 250, region: "America" },
{ label: "Canada", sales: 600, profit: 30, region: "America" },
{ label: "Brazil", sales: 450, profit: 30, region: "America" },
{ label: "China", sales: 500, profit: 40, region: "Asia" },
{ label: "Japan", sales: 900, profit: 100, region: "Asia" }
]});
var colorModel = new MeanColorModel(new Color(Color.named.red), new Color(Color.named.green));
new TreeMap({store: dataStore,
areaAttr: "sales", colorAttr: "profit", groupAttrs: ["region"],
colorModel: colorModel }, dom.byId("treeMap"));
// changing the upper part of the DOM
var longText = "Lorem ipsum dolor sit ame..."
setTimeout(function(){
document.getElementById("text").innerText = longText;
}, 500)
});
});
<p id="text"></p>
<div>
<div id="treeMap" style="width:600px;height:600px"></div>
</div>
When viewing this jsfiddle http://jsfiddle.net/ibmjs/GtAy7/ in IE, all the country labels appear as "null".
Thanks @harbalk for the finding.
It is already working, however one might want to reverse the treemap layout direction in RTL which is not feasible.
In addition to supporting flat stores on which we build ourselves the hierarchy support as well hierarchical stores with getChildren method.
Would require at least an implementation of such as store in Dojo for proper testing (there is none right now).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.