-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RELATED: ONE-3065 Scatter plot - production ready
- Loading branch information
1 parent
cfc9615
commit 77b748a
Showing
42 changed files
with
597 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// (C) 2007-2018 GoodData Corporation | ||
import React, { Component } from 'react'; | ||
import { ScatterPlot } from '@gooddata/react-components'; | ||
|
||
import '@gooddata/react-components/styles/css/main.css'; | ||
|
||
import { | ||
projectId, | ||
franchiseFeesIdentifier, | ||
franchisedSalesIdentifier, | ||
locationResortIdentifier | ||
} from '../utils/fixtures'; | ||
|
||
export const CUSTOM_COLORS = [ | ||
'rgba(195, 49, 73, 1)', | ||
'rgba(168, 194, 86, 1)', | ||
'rgba(243, 217, 177, 1)', | ||
'rgba(194, 153, 121, 1)' | ||
]; | ||
|
||
export class ScatterPlotExample extends Component { | ||
onLoadingChanged(...params) { | ||
// eslint-disable-next-line no-console | ||
console.log('ScatterPlotExample onLoadingChanged', ...params); | ||
} | ||
|
||
onError(...params) { | ||
// eslint-disable-next-line no-console | ||
console.log('ScatterPlotExample onError', ...params); | ||
} | ||
|
||
render() { | ||
const xMeasure = { | ||
measure: { | ||
localIdentifier: 'franchiseFeesIdentifier', | ||
definition: { | ||
measureDefinition: { | ||
item: { | ||
identifier: franchiseFeesIdentifier | ||
} | ||
} | ||
}, | ||
format: '#,##0' | ||
} | ||
}; | ||
|
||
const yMeasure = { | ||
measure: { | ||
localIdentifier: 'franchisedSalesIdentifier', | ||
definition: { | ||
measureDefinition: { | ||
item: { | ||
identifier: franchisedSalesIdentifier | ||
} | ||
} | ||
}, | ||
format: '#,##0' | ||
} | ||
}; | ||
|
||
const locationResort = { | ||
visualizationAttribute: { | ||
displayForm: { | ||
identifier: locationResortIdentifier | ||
}, | ||
localIdentifier: 'location_resort' | ||
} | ||
}; | ||
|
||
return ( | ||
<div style={{ height: 300 }} className="s-scatter-plot"> | ||
<ScatterPlot | ||
projectId={projectId} | ||
xAxisMeasure={xMeasure} | ||
yAxisMeasure={yMeasure} | ||
attribute={locationResort} | ||
onLoadingChanged={this.onLoadingChanged} | ||
onError={this.onError} | ||
config={{ colors: CUSTOM_COLORS }} | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default ScatterPlotExample; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.