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

Unknown props on <g> tag in a lot of Victory Components #508

Closed
sto3psl opened this issue Mar 6, 2017 · 6 comments
Closed

Unknown props on <g> tag in a lot of Victory Components #508

sto3psl opened this issue Mar 6, 2017 · 6 comments
Assignees
Labels
Type: Bug 🐛 Oh no! A bug or unintentional behavior

Comments

@sto3psl
Copy link
Contributor

sto3psl commented Mar 6, 2017

First of all thank you for this great library, it helped a lot with the data visualizations at the company I'm working at.

Since updating to Victory 0.18.0 I get a lot of React warnings about unknown props on <g> tags.

Browser: Chrome 56
OS: macOS 10.12.3
Victory version: 0.18.0

Here are 2 warnings I get from using VictoryBar and VictoryAxis :

Warning: Unknown props `index`, `domain`, `standalone`, `theme` on <g> tag. Remove these props from the element. For details, see https://fb.me/react-unknown-prop
    in g
    in svg (created by VictoryContainer)
    in VictoryContainer
    in VictoryBar (created by CustomBarChart)
    in CustomBarChart (created by Component)
    in div (created by Component)
    in Component (created by Component)
    in div (created by Component)
    in Component (created by Component)
    in div (created by Component)
    in div (created by Component)
    in Component

Warning: Unknown prop `clipWidth` on <g> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop
    in g
    in g (created by VictoryContainer)
    in VictoryContainer
    in VictoryAxis (created by VictoryAxis)
    in VictoryAnimation (created by VictoryTransition)
    in VictoryTransition (created by VictoryAxis)
    in VictoryAxis (created by BarChartStacked)
    in svg (created by VictoryContainer)
    in VictoryContainer
    in VictoryChart (created by BarChartStacked)
    in div (created by BarChartStacked)
    in BarChartStacked (created by Component)
    in div (created by Component)
    in Component (created by Component)
    in div (created by Component)
    in Component (created by Component)
    in div (created by Component)
    in div (created by Component)
    in Component

It even happens with this component:

function CustomBarChart (props) {
  return (
    <VictoryBar data={props.data} />
  )
}

Here is the data:

[
  {
    "x": "Label 1",
    "y": 0.328
  },
  {
    "x": "Label 2",
    "y": 0.289
  },
  {
    "x": "Label 3",
    "y": 0.081
  },
  {
    "x": "Label 4",
    "y": 0.061
  },
  {
    "x": "Label 5",
    "y": 0.085
  },
  {
    "x": "Label 6",
    "y": 0.112
  },
  {
    "x": "Label 7",
    "y": 0.044
  }
]

It may be that the default groupComponent, a normal svg <g> get's bad props from the React.cloneElement() function in renderData().

Here is also a screenshot with the props of the element:

bildschirmfoto 2017-03-06 um 17 00 13

If you need any more information I will try to provide them.

@boygirl
Copy link
Contributor

boygirl commented Mar 6, 2017

@sto3psl thanks. I added a ton of props to container components in the latest release. I'll filter them out before rendering g tags.

@sto3psl
Copy link
Contributor Author

sto3psl commented Mar 7, 2017

That's cool. Thanks a lot.

@sto3psl
Copy link
Contributor Author

sto3psl commented Mar 7, 2017

#296 This issue seems to reference the same problems.

@boygirl boygirl self-assigned this Mar 11, 2017
@boygirl boygirl added the Type: Bug 🐛 Oh no! A bug or unintentional behavior label Mar 11, 2017
@boygirl
Copy link
Contributor

boygirl commented Mar 16, 2017

fixed in victory@0.18.2

@boygirl boygirl closed this as completed Mar 16, 2017
@matejstrasek
Copy link

matejstrasek commented Mar 21, 2017

Using victory@0.18.2 and still getting this when wrapping VictoryBar with VictoryChart.

<VictoryChart animate={{ duration: 2000 }}>
    <VictoryBar
        data={[
            {month: 'September', profit: 35000, loss: 2000},
            {month: 'October', profit: 42000, loss: 8000},
            {month: 'November', profit: 55000, loss: 5000}
        ]}
        x='month'
        y={datum => datum.profit - datum.loss}
    />
</VictoryChart>

Warning: Unknown prop clipWidth on tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop
in g
in g (created by VictoryContainer)
in VictoryContainer
in VictoryBar (created by VictoryBar)
in VictoryAnimation (created by VictoryTransition)
in VictoryTransition (created by VictoryBar)
in VictoryBar (created by MyGraph)
in svg (created by VictoryContainer)
in VictoryContainer
in VictoryChart (created by MyGraph)

@sto3psl
Copy link
Contributor Author

sto3psl commented Mar 21, 2017

This is known and I think already in progress. Here is the issue for the clipWidth prop #526.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 Oh no! A bug or unintentional behavior
Projects
None yet
Development

No branches or pull requests

3 participants