Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trimming node lables #10

Closed
bmesuere opened this issue Aug 14, 2019 · 0 comments
Closed

Trimming node lables #10

bmesuere opened this issue Aug 14, 2019 · 0 comments
Labels

Comments

@bmesuere
Copy link
Member

There is no option to trim node labels. This causes some overlap issues for long EC and GO names.

example:
screen shot 2016-06-27 at 17 32 08

In the previous treeview I added the following piece of code to trim the nodes:

            nodeEnter.append("text")
                .attr("x", function (d) {
                    return isLeaf(d) ? -10 : 10;
                })
                .attr("dy", ".35em")
                .attr("text-anchor", function (d) {
                    return isLeaf(d) ? "end" : "start";
                })
                .text(function (d) {
                    return d.name.length > 33 && (d._children || d.children) ? d.name.substring(0,30).trim()+"..." 
: d.name;
                })
                .style("font", "10px sans-serif")
                .style("fill-opacity", 1e-6);

Original issue by calmalak on Mon Jun 27 2016 at 17:34.
Closed by @bmesuere on Mon Jun 27 2016 at 17:57.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant