-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(waffle): add support for custom tooltip on all components
- Loading branch information
Raphaël Benitte
committed
May 26, 2018
1 parent
164de13
commit 96047dd
Showing
23 changed files
with
539 additions
and
156 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 |
---|---|---|
@@ -1,90 +1,102 @@ | ||
capture: | ||
baseUrl: http://localhost:3000 | ||
pages: | ||
- path: /#/bar | ||
- path: /bar | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-bar/doc/bar.png | ||
|
||
- path: /#/bar/canvas | ||
- path: /bar/canvas | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-bar/doc/bar-canvas.png | ||
|
||
- path: /#/calendar | ||
- path: /calendar | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-calendar/doc/calendar.png | ||
|
||
- path: /#/chord | ||
- path: /chord | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-chord/doc/chord.png | ||
|
||
- path: /#/chord/canvas | ||
- path: /chord/canvas | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-chord/doc/chord-canvas.png | ||
|
||
- path: /#/bubble | ||
- path: /bubble | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-circle-packing/doc/bubble.png | ||
|
||
- path: /#/bubble/html | ||
- path: /bubble/html | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-circle-packing/doc/bubble-html.png | ||
|
||
- path: /#/bubble/canvas | ||
- path: /bubble/canvas | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-circle-packing/doc/bubble-canvas.png | ||
|
||
- path: /#/heatmap | ||
- path: /heatmap | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-heatmap/doc/heatmap.png | ||
|
||
- path: /#/heatmap/canvas | ||
- path: /heatmap/canvas | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-heatmap/doc/heatmap-canvas.png | ||
|
||
- path: /#/line | ||
- path: /line | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-line/doc/line.png | ||
|
||
- path: /#/pie | ||
- path: /pie | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-pie/doc/pie.png | ||
|
||
- path: /#/radar | ||
- path: /radar | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-radar/doc/radar.png | ||
|
||
- path: /#/sankey | ||
- path: /sankey | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-sankey/doc/sankey.png | ||
|
||
- path: /#/scatterplot | ||
- path: /scatterplot | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-scatterplot/doc/scatterplot.png | ||
|
||
- path: /#/scatterplot/canvas | ||
- path: /scatterplot/canvas | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-scatterplot/doc/scatterplot-canvas.png | ||
|
||
- path: /#/stream | ||
- path: /stream | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-stream/doc/stream.png | ||
|
||
- path: /#/sunburst | ||
- path: /sunburst | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-sunburst/doc/sunburst.png | ||
|
||
- path: /#/treemap | ||
- path: /treemap | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-treemap/doc/treemap.png | ||
|
||
- path: /#/treemap/html | ||
- path: /treemap/html | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-treemap/doc/treemap-html.png | ||
|
||
- path: /#/treemap/canvas | ||
- path: /treemap/canvas | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-treemap/doc/treemap-canvas.png | ||
|
||
- path: /#/voronoi | ||
- path: /voronoi | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-voronoi/doc/voronoi.png | ||
|
||
- path: /waffle | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-waffle/doc/waffle.png | ||
|
||
- path: /waffle/html | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-waffle/doc/waffle-html.png | ||
|
||
- path: /waffle/canvas | ||
selector: .chart-tabs--chart | ||
output: ./packages/nivo-waffle/doc/waffle-canvas.png |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
"files": [ | ||
"README.md", | ||
"index.js", | ||
"index.d.ts", | ||
"cjs/" | ||
], | ||
"dependencies": { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* This file is part of the nivo project. | ||
* | ||
* Copyright 2016-present, Raphaël Benitte. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import { BasicTooltip } from '@nivo/core' | ||
|
||
const WaffleCellTooltip = ({ | ||
position, | ||
row, | ||
column, | ||
color, | ||
data, | ||
theme, | ||
tooltipFormat, | ||
tooltip, | ||
}) => ( | ||
<BasicTooltip | ||
id={data.label} | ||
value={data.value} | ||
enableChip={true} | ||
color={color} | ||
theme={theme} | ||
format={tooltipFormat} | ||
renderContent={ | ||
typeof tooltip === 'function' | ||
? tooltip.bind(null, { | ||
position, | ||
row, | ||
column, | ||
color, | ||
...data, | ||
}) | ||
: null | ||
} | ||
/> | ||
) | ||
|
||
WaffleCellTooltip.displayName = 'WaffleCellTooltip' | ||
WaffleCellTooltip.propTypes = { | ||
position: PropTypes.number.isRequired, | ||
row: PropTypes.number.isRequired, | ||
column: PropTypes.number.isRequired, | ||
color: PropTypes.string.isRequired, | ||
data: PropTypes.object.isRequired, | ||
theme: PropTypes.object.isRequired, | ||
tooltipFormat: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), | ||
tooltip: PropTypes.func, | ||
} | ||
|
||
export default WaffleCellTooltip |
Oops, something went wrong.