Kcnarf / d3-voronoi-treemap

D3 plugin which computes a treemap based on a Voronoi tesselation
BSD 3-Clause "New" or "Revised" License
203 stars 19 forks source link

Manually set the initial position #7

Open WYanChao opened 5 years ago

WYanChao commented 5 years ago

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.

Kcnarf commented 5 years ago

I rephrase your first comment in order to be sure to well understand it.

Your use case is:

  1. you have n data, each with their own v value
  2. you compute a first Voronoï treemap
  3. you update the values of your data: you still have the same n data, but now each defining v' value

==> your need is to be able to update the already computed Voronoï treemap in order to reflect the new v' values ==> you propose to introduce an initial position API, so that you can compute a second Voronoï treemap by reusing the position of the first Voronoï treemap

Am I right?

WYanChao commented 5 years ago

Thanks very much for your reply.

Yes, it is exactly what I want.


From: LEBEAU Franck notifications@github.com Sent: Thursday, February 21, 2019 6:01:50 PM To: Kcnarf/d3-voronoi-treemap Cc: #WANG YANCHAO#; Author Subject: Re: [Kcnarf/d3-voronoi-treemap] Manually set the initial position (#7)

I rephrase your first comment in order to be sure to well understand it.

Your use case is:

  1. you have n data, each with their own v value
  2. you compute a first Voronoï treemap
  3. you update the values of your data: you still have the same n data, but now each defining v' value

==> your need is to be able to update the already computed Voronoï treemap in order to reflect the new v' values ==> you propose to introduce an initial position API, so that you can compute a second Voronoï treemap by reusing the position of the first Voronoï treemap

Am I right?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Kcnarf/d3-voronoi-treemap/issues/7#issuecomment-465938059, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVcg91DOUnLy3j965GMQXvIgu0-OO6byks5vPm6OgaJpZM4Z5F1Q.