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

Make width and height optional in label array #1

Open
arunkjn opened this issue Jan 6, 2014 · 1 comment
Open

Make width and height optional in label array #1

arunkjn opened this issue Jan 6, 2014 · 1 comment

Comments

@arunkjn
Copy link

arunkjn commented Jan 6, 2014

Width can be approximated by text.length() and a fixed default height can be given. This will make it easier to use.

@Fil
Copy link

Fil commented Mar 11, 2014

this is easy to add to pull-request #3 with the following code:

      if ((typeof lab[i].width == 'undefined') || (typeof lab[i].height == 'undefined')) {
        if (typeof lab[i].width == 'undefined') lab[i].width = lab[i].name.length*6;
        if (typeof lab[i].height == 'undefined') lab[i].height = 8;
      }

width = 6 * name.length works for me, but it would be better if we could use the label object to find the label itself and measure its bounding box. Unfortunately, the way it is programmed now, we work outside the svg object.

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

No branches or pull requests

2 participants