Skip to content

Commit

Permalink
Add video to pan zoom and add to docs sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
keithluchtel committed Nov 20, 2024
1 parent 0bebf4b commit caecfe2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Binary file added website/docs/assets/line.mp4
Binary file not shown.
17 changes: 17 additions & 0 deletions website/docs/pan-zoom.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
import ReactPlayer from "react-player/lazy";
import lineMp4 from "./assets/line.mp4";

# Pan/Zoom

The `CartesianChart` and `PolarChart` components have opt-in support for "pan/zoom" gestures simply by using the `useChartTransformState` hook.

<div className="flex justify-center mb-10">
<div className="rounded-md overflow-hidden border shadow">
<ReactPlayer
width={350}
height={(1096 / 764) * 350}
playing={true}
loop={true}
controls={true}
url={lineMp4}
/>
</div>
</div>


## useChartTransformState

The `useChartTransformState` hook provides the necessary state management for pan and zoom gestures. It returns an object with a `state` property that contains:
Expand Down
1 change: 1 addition & 0 deletions website/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const sidebars = {
},

"animated-paths",
"pan-zoom",
],
// By default, Docusaurus generates a sidebar from the docs folder structure
// tutorialSidebar: [{ type: "autogenerated", dirName: "." }],
Expand Down

0 comments on commit caecfe2

Please sign in to comment.