Skip to content

Commit

Permalink
Add more controls
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking committed Jun 16, 2022
1 parent 442a653 commit 229fce5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/ThreeDimensionalCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import { CameraInitProps } from './types';

export type ThreeDimensionalCanvasProps = {
children?: React.ReactNode;
/**
* Whether or not to use an orthographic camera or not
* @default false
*/
orthographic?: boolean;
/**
* The camera's initial props. overrides the defaults
* @default { position: [0, 0, 1], zoom: 1, up: [0, 1, 0] }
Expand All @@ -14,9 +19,11 @@ export type ThreeDimensionalCanvasProps = {
export function ThreeDimensionalCanvas({
children,
camera,
orthographic = false,
}: ThreeDimensionalCanvasProps) {
return (
<Canvas
orthographic={orthographic}
camera={{
position: [0, 0, 1],
zoom: 1,
Expand Down
6 changes: 5 additions & 1 deletion stories/ColorByData.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Points,
} from '../src';
import { Container } from './components';
import data from './data/point-cloud-3d.json';
import _data from './data/point-cloud-3d.json';
import { interpolateYlGnBu } from 'd3-scale-chromatic';

const meta: Meta = {
Expand All @@ -32,6 +32,10 @@ const meta: Meta = {

export default meta;

const data = _data.map((d) => ({
...d,
metaData: { actualLabel: String(Math.floor(Math.random() * 50)) },
}));
const actualLabelsSet = data.reduce(
(acc, d) => acc.add(d.metaData.actualLabel),
new Set()
Expand Down

0 comments on commit 229fce5

Please sign in to comment.