coder-spirit / beautiful-tree Goto Github PK
View Code? Open in Web Editor NEWA library to generate beautiful trees in your website
Home Page: https://www.npmjs.com/package/@beautiful-tree/react
License: MIT License
A library to generate beautiful trees in your website
Home Page: https://www.npmjs.com/package/@beautiful-tree/react
License: MIT License
Besides the current orientation (top -> down), add the following extra orientations:
Add some "nice" badges to the README, so people can have a better idea about "quality metrics" at first sight.
It would be nice to have a small collection of examples of beautiful trees generated with our library.
Right now we are relying on ESLint and Prettier for linting, but this tooling combination is quire complex (and slow). Biomejs seems to be simpler to manage, and offer higher performance (we won't notice it much because Turborepo is already helping us, but it's worth to make everything as streamlined as possible).
It seems that we should split the exported types for ESM and CJS ( a thread on why: https://twitter.com/AndaristRake/status/1695549037556949344 )
Add a new layout algorithm that pushes all the leafs to the "bottom" layer of the rendered tree.
It won't be the main layout algorithm, but it can be useful for some people.
Reorganise the code so the package @beautiful-tree/react
is not at the root level of the repository, and we can have other packages as well.
Ideally, it should be done in a way that changes in a package only trigger the CI flow associated to that code and anything that depends on it, but nothing else (so we don't slow down our CI pipelines with useless work). Some tools that could help are Turbo Repo, or Nx.
This one is a precondition for the following tasks:
For some reason, it seems that Windows & Mac pipelines are much slower than those of Linux. It would be interesting to investigate what's behind that difference, and try to solve it if possible.
Sometimes we might want to render trees as if they were indices, using "new lines" and "tabulations" to denote the nesting level of an item within the tree.
Visual example:
BOOK
┣━ CHAPTER_1
┃ ┣━ FIGURE_A
┃ ┗━ FIGURE_B
┣━ CHAPTER_2
┗━ CHAPTER_3
┣━ SECTION_3A
┃ ┣━ FIGURE_C
┃ ┗━ FIGURE_D
┗━ FIGURE_E
The main changes belong to the @beautiful-tree/algorithms
package.
Besides introducing a new layout algorithm, we might have to modify the API of or @beautiful-tree/react
library.
This is because the current layout algorithms assume that the nodes will be drawn centered around each point given by the layout algorith; but in the case of the index-shaped layout, we want the nodes to be drawn on the "right side" of the given point (to ensure that they are always left-aligned with other nodes at the same level of depth).
Right now, we only have straight connector lines. For the index-shaped layouts we need to have vertical+corner+horizontal connectors (as depicted in the example above).
We already defined an independent task for this: #13 .
Allow dynamic inline styles, as they are quite useful when generating numeric values that can be predicted in advance (so we can't prepare specific CSS classes for them).
Right now, we are not adding the xmlns
attribute to the <div>
element inside the <foreignObject>
elements.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.