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

Simple way to have all captions on by default #390

Closed
ftrotter opened this issue Sep 11, 2014 · 2 comments
Closed

Simple way to have all captions on by default #390

ftrotter opened this issue Sep 11, 2014 · 2 comments
Labels
Milestone

Comments

@ftrotter
Copy link
Contributor

There should be a way to do this with a single configuration option.

@ghost
Copy link

ghost commented Sep 11, 2014

Agreed and will be added to the 0.3 release. In the meantime, an (admittedly hacky) workaround is to use CSS to set all text elements in an alchemy instance to "display: block."

.alchemy text {
    display: block !important;
}

The !important signifier is there to ensure it doesn't get overwritten by any of the many programmatic events that happen during initialization or user-interaction. Because we are moving to entirely programmatic styling in 0.3, the added configuration option will not have that problem.

If you require more control over when they show and when they don't, the javascript:

d3.selectAll(".alchemy text")
    .style("display", "block")

will do the same thing, and you can add the d3 on function to only show them on certain events like click or drag.

@ghost ghost added this to the v0.3 Release milestone Sep 11, 2014
@pgirase
Copy link

pgirase commented Jul 3, 2018

Even after adding the edgeCaptionsOnByDefault:true, I am not able to get the edges to display the text by default. Please note that the the similar option does work for nodes though by setting nodeCaptionsOnByDefault:true. I am using version 0.4.2 of alchemy.js

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

3 participants