+ )
+ }
+}
diff --git a/website/src/components/charts/line/Components/LineSvg.js b/website/src/components/charts/line/Components/LineSvg.js
new file mode 100644
index 000000000..593600fac
--- /dev/null
+++ b/website/src/components/charts/line/Components/LineSvg.js
@@ -0,0 +1,59 @@
+/*
+ * 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, { PureComponent } from 'react'
+import ComponentPropsDocumentation from '../../../properties/ComponentPropsDocumentation'
+
+const properties = [
+ {
+ key: 'xScale',
+ type: '{Function}',
+ required: true,
+ },
+ {
+ key: 'yScale',
+ type: '{Function}',
+ required: true,
+ },
+ {
+ key: 'curve',
+ type: '{string}',
+ required: true,
+ },
+ {
+ key: 'lineWidth',
+ type: '{number}',
+ required: true,
+ },
+ {
+ key: 'animate',
+ type: '{boolean}',
+ required: true,
+ },
+ {
+ key: 'motionDamping',
+ type: '{number}',
+ required: true,
+ },
+ {
+ key: 'motionStiffness',
+ type: '{number}',
+ required: true,
+ },
+]
+
+export default class LineSvg extends PureComponent {
+ render() {
+ return (
+
+
LineSvg
+
+
+ )
+ }
+}
diff --git a/website/src/components/charts/line/Components/index.js b/website/src/components/charts/line/Components/index.js
new file mode 100644
index 000000000..9a5a3d783
--- /dev/null
+++ b/website/src/components/charts/line/Components/index.js
@@ -0,0 +1,29 @@
+/*
+ * This file is part of the nivo project.
+ *
+ * (c) 2016 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 Helmet from 'react-helmet'
+import LineSvg from './LineSvg'
+import LineAreaSvg from './LineAreaSvg'
+
+const Components = () => (
+
The responsive alternative of this component is{' '}
- ResponsiveLineChartSvg.
+ ResponsiveLineChartSvg, it also offers another implementation, see{' '}
+ LineChartCanvas.
This component is available in the{' '}
@@ -93,6 +94,17 @@ export default class LinePage extends Component {
the storybook
.
+
+ For more advanced features (eg.{' '}
+
+ dual y axis
+ ) or mixing with other chart types, you can also build your own chart using{' '}
+ @nivo/line low level components.
+
See the dedicated guide on how to setup
legends for this component.
diff --git a/website/src/components/charts/line/LineCanvas/index.js b/website/src/components/charts/line/LineCanvas/index.js
index c7daed8f8..a1bedac44 100644
--- a/website/src/components/charts/line/LineCanvas/index.js
+++ b/website/src/components/charts/line/LineCanvas/index.js
@@ -40,14 +40,14 @@ export default class LinePage extends Component {
const mappedSettings = propsMapper(settings)
- const code = generateCode('ResponsiveLine', mappedSettings, {
+ const code = generateCode('ResponsiveLineChartCanvas', mappedSettings, {
pkg: '@nivo/line',
defaults: LineDefaultProps,
})
const header = (
@@ -55,46 +55,15 @@ export default class LinePage extends Component {
const description = (
-
Line chart with stacking ability.
-
- Given an array of data series having an id and a nested array of points (with x,
- y properties), it will compute the line for each data serie. If stacked is
- true, y values will be automatically aggregated.
- This component also accept empty values, but please note that they must be
- explicitly defined though, eg. {'{ x: 10, y: null }'}.
-
-
- The responsive alternative of this component is ResponsiveLine.
-
- This component is available in the{' '}
-
- nivo-api
- , see{' '}
-
- sample
- {' '}
- or try it using the API client. You can also see
- more example usages in{' '}
-
- the storybook
- .
+ A variation around the LineChartSvg component. Well
+ suited for large data sets as it does not impact DOM tree depth and does not
+ involve React diffing stuff for children (not that useful when using canvas),
+ however you'll lose the isomorphic ability and transitions.
- See the dedicated guide on how to setup
- legends for this component.
+ The responsive alternative of this component is{' '}
+ ResponsiveLineChartCanvas.