Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Voronoi stack #555

Merged
merged 24 commits into from
Jun 20, 2018
Merged

Voronoi stack #555

merged 24 commits into from
Jun 20, 2018

Conversation

stefvhuynh
Copy link
Contributor

@stefvhuynh stefvhuynh commented Jan 20, 2018

Fixes FormidableLabs/victory#619.
Requires FormidableLabs/victory-core#332.

Component from issue for testing:

render() {
    const chartProps = {
        containerComponent: <VictoryVoronoiContainer labels={(d) => d.y} />
        // containerComponent: <VictoryVoronoiContainer />
    }

    const areaProps = [
        {
            data: [
                { x: 1, y: 3 },
                { x: 2, y: 3 },
                { x: 3, y: 3 },
            ],
            // labelComponent: <VictoryTooltip />,
            // labels: (d) => d.y
        },
        {
            data: [
                { x: 1, y: 1 },
                { x: 2, y: 1 },
                { x: 3, y: 1 },
            ],
            // labelComponent: <VictoryTooltip />,
            // labels: (d) => d.y
        }
    ]

    return (
        <VictoryChart {...chartProps}>
            <VictoryStack>
                <VictoryArea {...areaProps[0]} />
                <VictoryArea {...areaProps[1]} />
            </VictoryStack>
        </VictoryChart>
    )
}

Toggle comments to ensure labels works in both cases.

@stefvhuynh
Copy link
Contributor Author

There is an issue with the very last chart in the voronoi container demo. Hovering no longer highlights the bars. Chart in question:
screen shot 2018-01-19 at 4 45 47 pm

@boygirl
Copy link
Contributor

boygirl commented Jun 16, 2018

More work necessary. This implementation destroys voronoiBlacklist functionality

@f0rr0
Copy link

f0rr0 commented Jun 17, 2018

@boygirl not sure if this would be related but I observed that voronoi container has some unexpected behaviour https://codesandbox.io/s/4z6ww6w7m0

@boygirl
Copy link
Contributor

boygirl commented Jun 19, 2018

Depends on FormidableLabs/victory-core#390

@boygirl
Copy link
Contributor

boygirl commented Jun 19, 2018

@f0rr0 yes, that looks potentially related. The issue was that voronoi data was naive. None of the calculated data values were i.e. _x0, _y0 were being used when determining the voronoi. I think that might be causing the issue you're seeing as well, but I will double check before I release this change (probably tomorrow)

@boygirl boygirl merged commit 3746745 into master Jun 20, 2018
@boygirl boygirl deleted the voronoi-stack branch June 20, 2018 21:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants