almende / vis

⚠️ This project is not maintained anymore! Please go to https://github.com/visjs
7.85k stars 1.48k forks source link

Graph2d: select Event #311

Open Gillingham opened 10 years ago

Gillingham commented 10 years ago

A select event on the graph2d version of timeline would be very useful, the docs page, http://visjs.org/docs/graph2d.html#Events, actually has a sample 'select' event but I think it was just left over from a copy/paste of the timeline docs.

AlexDM0 commented 10 years ago

Hi,

This was indeed a poorly copied over example. There is no select in graph2d as it is now. Problem with graph2d selection, is that there is nothing to select at the moment. What would you think is a good thing to select? Curves? Datapoints?

I'm not sure yet what a useful select would be.

Regards,

Alex

Gillingham commented 10 years ago

Data points definitely, being able to get the currently selected Item would be very useful for doing something like displaying a popover/tooltip/whatever containing the current x/y values plus any custom metadata.

Being able to select the curve would be useful as well, something like highlighting the currently selected curve and displaying the x/y values at the point the cursor is at is a thing I've seen on other graphs, but I think that's probably less important than being able to select the data points themselves.

AlexDM0 commented 10 years ago

Hi,

Problem is that the datapoints are not necessarily objects that are drawn. Yes you can choose to show them on the graph, but for a tooltip we'd need a more in depth solution. I still have tooltips on my todo list and once those are in place, it would be easy to get events like hover etc. I'll implement these features when I'll need them but I'm not sure when this will be.

Curve highlighting events would be cool as well, accompanied by legend highlighting and an event if the user has custom legends.

I'm not sure when these will be implemented though. Feel free to do a pull request if you find the time :).

Regards,

Alex

Gillingham commented 10 years ago

If the data points are shown, then a select event for just that would be fine, not having it when they aren't rendered would be acceptable since you can't have an event for invisible things.

I think having that would be more useful than a vis provided tooltip. I usually embed additional information into the Item DataSets which is something I can then use inside a custom event instead of relying on built in tooltips or providing each node with a fixed prepopulated HTML tooltip.

AlexDM0 commented 10 years ago

What I had in mind for the tooltip was in fact to "click" on invisible datapoints. Once that's done, tooltip and/or events are easy and regardless of drawing style.

Since this is drawn with svg, there are no direct bindings to dom elements (you could of course but you'd be limited to drawing style).

Hence I think the select event is a consequence of the tooltips, not a primary goal. Does that make sense?

Regards

Alex

AlexDM0 commented 9 years ago

Hi,

Over the last year a lot of feature requests have been made. We have just introduced our new website which has a list of the requested features. We have placed this request on that list.

The list can be found here: http://visjs.org/featureRequests.html

An explaination of the new system can be found here: http://visjs.org/blog.html#New\ website\ for\ vis.js!

I would like to stress that this does not mean we abandon this request. Discussion here will continue if needed on this feature but we will close it to keep our Github issue page more of a bug-todo list.

Future feature requests will still be made here and then added to the website by us.

Regards,

Alex

mojoaxel commented 7 years ago

Reopening as Feature-Request issue (see #2114). Everybody: Please feel free to implement this!