kcnarf / d3-voronoi-treemap Goto Github PK
View Code? Open in Web Editor NEWD3 plugin which computes a treemap based on a Voronoi tesselation
License: BSD 3-Clause "New" or "Revised" License
D3 plugin which computes a treemap based on a Voronoi tesselation
License: BSD 3-Clause "New" or "Revised" License
Hi,
This is excellent work and looks beautiful and I am excited to use this in my projects, thank you!
In my use case, the clip changes, and transitions between a rectangle and an ellipse and back. The problem I'm experiencing is that in order to correctly fill the space in both cases (and in between), I need to update the layout, which, as far as I know, recomputes the layout from scratch and comes up with a completely new layout. This results in jumping between two completely separate layouts, and is even more hectic during the transitions.
Is there any chance for an update function that can try to find a correct layout that starts with the current layout, or maybe the same seed points?
Thank you!
Hi @Kcnarf - Do you what triggers error cannot set property twin of null error. This algorithm works most of the time but very rarely gives this error.
I am not sure when it is happening exactly.
Hi,
Is it possible to have an API to set the initial position of each node? I understand that this d3-voronoi-treemap is based your previous d3-voronoi-map. The reason to add this API is that your current voronoi treemap is not suitable for dynamic hierarchical data.
My current solution is to set the .prng to a seedable PRNG for dynamic hierarchical data and generate them separately. I don't think it is an efficient way to update the voronoi treemap.
Thanks.
In your readme, you have:
var allNodes = rootNode.descendants;
which will cause a subtle failure later in your sample code. The line should be:
var allNodes = rootNode.descendants();
Also, while I did figure it out eventually, it would be helpful for people new to d3 if you defined cellLiner at least, and possibly gave a sample weightAccessor and fillScale.
Thanks for contributing this project.
Recently, Svelte started to use the latest version of vite to for new projects. Vite doesn't support the current way of importing functions in the "src/d3-voronoi-treemap.js". I found out that way to make the package works again is to replace the first line of "src/d3-voronoi-treemap.js" to import * as voronoiMap from 'd3-voronoi-map'
. Could the development team of d3-voronoi-map considering changing the file to make it compatible to vite environment? Thank you!
Hello,
How is it possible to change stroke width for every groups?
i am in the process of building a nice chart on observable with this library, but my console gets swamped with log messages from the code. it looks like there have been a few changes from the latest 1.1.0 release, including removal of these console log messages. any chance you bump the version and push the release?
I know this library is depends on some of the d3 libraries. But what are the chances of making it completely independent of d3 ?
If you remove the dependency ,it will easy to transform this to any other programming language and use it on any other platform.
This issue is a continuation of a discussion initiated in the d3/d3-voronoi's issue#5.
Summary of previous discussion :
@Svmali84 - So can I make use of it (i.e. d3-voronoi-treemap) on my website free ? I see it is under GPL-3 license. So putting copyright is sufficient ?
@micahstubbs - I imagine that you can use it so long as you do not distribute it. this stackoverflow answer may help ๐ https://stackoverflow.com/a/2281266/1732222
@micahstubbs - we could also ask @Kcnarf if he would be willing to release d3-voronoi under a more liberal license, like for example the BSD-3-Clause license that d3 itself is released under or the popular MIT license
Hi - it'd be quite useful to be able to pad child hierarchies a bit, so it's clearer what the top-level polygons are, compared to lower level ones.
You can set the stroke width as discussed in #8 but that doesn't always look good and has issues with the lines overlapping child polygons; I'd like to be able to pass a padding function that returns the desired padding based on tree depth.
(I'm going to try to see if I can implement this and raise a PR, thought I'd raise an issue for discussion first)
The D3-voronoi-map dependency in this project is not the updated version which has bug fixes.
Greetings,
Receiving the subject error from the below code:
var stratify = d3.stratify()
.id(function(d) { return d.id_field; })
.parentId(function(d) { return d.parent_field; });
let tree = stratify(data);
function weightAccessor(d) {
return d.value_field;
}
var rootNode = d3.hierarchy(tree, d => d.values);
rootNode.sum(weightAccessor);
var voronoiTreemap = d3.voronoiTreemap().clip([[0, 0], [0, h], [w, h], [w, 0]]);
voronoiTreemap(rootNode);
Using all the latest versions of the libs and loading in the correct order:
<script type="text/javascript" src="../libs/vendor/d3-weighted-voronoi.js"></script> <script type="text/javascript" src="../libs/vendor/d3-voronoi-map.js"></script> <script type="text/javascript" src="../libs/vendor/d3-voronoi-treemap.js"></script>FYI - using d3 v5
Any advice for correcting the error?
Thanks and Great Work!
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.