-
Notifications
You must be signed in to change notification settings - Fork 12k
Description
Feature Proposal
For the chart's data attribute, I'm noting I'm struggling "reassociating the plot point" to the initial object it came from.
Implementation attempt: I have a graph with X axis for months and the Y axis for a $ value
I'm trying to implement a click action and finding that I'm having issues mapping over from the "selected value's label" to the initial type of object selected just from an almost arbitrary text selection. Having multiple charts all mapping to that makes this difficult to filter.
Possible Implementation
I don't know if this can fit on the ActiveDataPoint interface? but having the actual "object" (iff at all can be mapped to one) returned would be a great adjustment. I think y'all map this object with/as the TData type(?) in your types.
Appending some kinda "dataRepresents"/"dataModel" some type of actual object field that returns that same TData would make it suuuuuper convenient to map through actions more efficiently for any catches to onClick actions without having to find the initial data point clicked, potentially returned as part of the onClick interface. The InteractionItem interface seems like it could/should fit this entity (references the item touched)
Having that initial object reference returned on a click allows for much cleaner actions internally without having to map out the selected value to an initial object iff any without appending it into the precise data in some standardized format.
As stated I think this can fit (? I'm making all sorts of assumptions with that) on the TData (? again assertions being made on my assumption of the best spot) as like a <T|null|undefined> type (? not sure that's the best fit for your resource)
Again all in an effort to reduce the amount of code I as the implementor needs to write in order to get back to the initial object/record that data represents to maybe apply a function that expects that object in order to "do the generic thing" the instance I'm writing is an attempt to "zoom to the value". I open on a year/month (x axis 1-12) view, on click I want to zoom in to a month/day (x axis 1-31 change) view. I don't think this should replace any current x/y attributes by any means, but the hook allows for a great ease of client side work to map a click out to a meaningful piece of data to do more with