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

add fontSize property to label-series #1276

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dandgerson
Copy link

Thank you for amazing library. It very useful in our production.

I want to add some functional to our label-series
I have to some customize fontSize property for labels and suggest this feature.

I had this small PR as fist step. I would be glad to continue commit

Example:

<LabelSeries
          animation={animation}
          className={className}
          rotation={labelRotation}
          labelAnchorY="text-before-edge"
          data={nodesCopy.map((node, i) => {
            return {
              x: node.x0 + (node.x0 < width / 2 ? nWidth + 10 : -10),
              y: (node.y0 + node.y1) / 2 - marginTop,
              label: node.name,
              style: {
                textAnchor: node.x0 < width / 2 ? 'start' : 'end',
                dy: '-.5em',
                fontSize: node.fontSize || 'inherit', // add fontSize
                ...style.labels
              },
              // unfortunately this can not be ...node as the version
              // found in nodesCopy is modified by the sankey process
              ...nodes[i]
            };
          })}
        />

@CLAassistant
Copy link

CLAassistant commented Nov 14, 2019

CLA assistant check
All committers have signed the CLA.

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

Successfully merging this pull request may close these issues.

2 participants