With D3FC we decided to create a drop-in replacement for the D3 axis, with a more flexible API that makes it easier to customise the appearance (without the need for post selection), and includes common features such as the ability to center axis labels, and rotate labels if they collide. Therefore, if the axis doesn’t allow a given customisation, the recommended approach is to modify the DOM elements after the axis has been rendered - a technique called post selection. The elements created by the axis are considered part of its public API. Interestingly the API docs have the following to say: The D3 axis API is quite simple, beyond setting the the number of ticks and length of tick lines themselves, there is little else you can modify. from input domain to pixels on the screen). The axis component provides a visual representation of its associated scale, with the scale itself performing the underlying logic of mapping between coordinate systems (e.g. The D3 axis component is one of the more complex visual components within the D3 library, the other visual D3 components tend to be quite low-level (paths, chords, polygons, shapes). This blog post demonstrates some of these features and how they were implemented. positioning labels between ticks) and rotation / offset of labels to avoid collisions. Recently we’ve been looking at enhancing the D3 axis component to implement a number of common features including more flexible label placement (e.g. cartesian charts), by extending the D3 vocabulary to include series, annotations and of course charts themselves. Our goal with D3FC is to make it easier to create conventional charts (i.e. It has a relatively low-level API, allowing you to create a highly diverse range of data-driven graphics based on SVG elements and canvas. D3 is a popular and widely used library for creating bespoke visualisation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |