Replies: 1 comment
-
We rely on a clear distinction between the public API and the implementation, so we try to never expose "internals". But there are many places within the API where you can plug in your own functions. Furthermore, Plot.plot returns a svg DOM element that you can also manipulate as you wish with D3. This DOm element also has methods that allow you to retrieve the scales and so on. One part of the API that is super-rich and admittedly not well documented yet is the render option. It's often there that you can program "extend" a "classic" mark, with transitions, interactions, etc. — with the same freedom as in D3, but with all the setup done by Plot. See https://github.com/observablehq/plot/pull/1811/files for a draft documentation. (Depending on your needs there are other places where you can plug in your own code — but this one is particularly versatile and fun to use.) |
Beta Was this translation helpful? Give feedback.
-
I think I can achieve a great level of customization by using the exposed APIs in the documentation. So I think I am more interested in "extending" it or creating third party plugins which might need to access some of Plot's internals.
I am evaluating Plot for a potential project that needs custom data visualizations. One example would be, if I have a chart and a table on the same page, click on part of the chart will update/filter the table. This requires binding custom click event on the Plot chart and update the state of the table, etc. Another example would be, what if I want to customize the styles of smaller details like axis ticks, add borders to bars, etc.
I want to fully understand the extent of Plot's ability to customize. Or should I just start with D3? I prefer Plot since it is much easier to get started with.
I don't find any info in the documentation: https://observablehq.com/plot/
Or is there an unofficial way to do these?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions