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

fix(typescript): Fix TableTooltip and LineComputedSerieDatum-type on line #428

Merged

Conversation

johnolos
Copy link
Contributor

@johnolos johnolos commented Jan 17, 2019

Slight fix for TableTooltip, sorry about that.

Also, I found LineComputedSerieDatum useful exported subtype when creating custom layers upon Line. Basically for when customizing computedData with additional effects.

  getCustomLayer = (props: CustomProps) => {
    const { xScale, yScale, computedData } = props;
    const areaGenerator = area<LineComputedSerieDatum>()
      .x(d => xScale(d.data.x))
      .y0(() => yScale(0))
      .y1(d => yScale(d.data.y))
      .curve(curveMonotoneX);
    ...
    return <path
        ...
        d={areaGenerator(data)}
      />;
  };

@plouc How accepting would you be of a PR adding defs to Line?
Line isn't using it directly, but custom layers might, and therefore it would be helpful to add patterns to the main SVG element.

Work-around is to have a seperate svg element with pattern defined in the custom layer itself.

@plouc
Copy link
Owner

plouc commented Jan 24, 2019

@johnolos defs definition should be defined inside the core package IMO

@johnolos
Copy link
Contributor Author

@plouc Fair. I'll leave it for now.

@plouc plouc merged commit fd35f78 into plouc:master Jan 30, 2019
@plouc
Copy link
Owner

plouc commented Jan 30, 2019

Thank you for your contribution @johnolos

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