Skip to content

Commit

Permalink
Fix bugs in treemap, remove the data from the white list of animated …
Browse files Browse the repository at this point in the history
…properties
  • Loading branch information
bulyonov committed Aug 26, 2016
1 parent 0a6940b commit 81617c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/example/treemap/dynamic-treemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default class DynamicTreemapExample extends React.Component {
let title;
for (let i = 0; i < totalLeaves; i++) {
title = Math.random();
if (Math.random() > 1) {
if (Math.random() > 0.5) {
title = (
<b>{title}</b>
);
Expand Down
6 changes: 5 additions & 1 deletion src/lib/treemap/treemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ function getFontColorFromBackground(background) {
}

const ATTRIBUTES = ['opacity', 'color'];
const ANIMATED_PROPS = [
'colorRange', 'colorDomain', 'color',
'opacityRange', 'opacityDomain', 'opacity'
];

class Treemap extends React.Component {

Expand Down Expand Up @@ -159,7 +163,7 @@ class Treemap extends React.Component {
const nodes = this._getNodesToRender();
if (animation) {
return (
<Animation {...this.props} animatedProps={['data', 'colorRange', 'colorDomain', 'opacityRange', 'opacityDomain', 'color', 'opacity']}>
<Animation {...this.props} animatedProps={ANIMATED_PROPS}>
<Treemap {...this.props} animation={null}/>
</Animation>
);
Expand Down

0 comments on commit 81617c7

Please sign in to comment.