regl-worldview
Advanced tools
Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "regl-worldview", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "A reusable component for rendering 2D and 3D views using regl", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -101,3 +101,3 @@ // Copyright (c) 2018-present, GM Cruise LLC | ||
handleMouseEvent(objects: MouseEventObject[], e: MouseEvent, ray: Ray, mouseEventName: MouseEventEnum) { | ||
handleMouseEvent(objects: MouseEventObject[], ray: Ray, e: MouseEvent, mouseEventName: MouseEventEnum) { | ||
const mouseHandler = this.props[mouseEventName]; | ||
@@ -104,0 +104,0 @@ if (!mouseHandler || !objects.length) { |
@@ -12,2 +12,3 @@ // @flow | ||
import { storiesOf } from "@storybook/react"; | ||
import expect from "expect"; | ||
import React from "react"; | ||
@@ -19,3 +20,3 @@ import { withScreenshot } from "storybook-chrome-screenshot"; | ||
import { clickAtOrigin, WorldviewWrapper } from "../worldviewAssertionUtils"; | ||
import { assertionTest, expect } from "stories/assertionTestUtils"; | ||
import { assertionTest } from "stories/assertionTestUtils"; | ||
@@ -22,0 +23,0 @@ const defaultXAxis = { |
@@ -12,6 +12,7 @@ // @flow | ||
import { storiesOf } from "@storybook/react"; | ||
import expect from "expect"; | ||
import React from "react"; | ||
import { withScreenshot } from "storybook-chrome-screenshot"; | ||
import { assertionTest, expect } from "stories/assertionTestUtils"; | ||
import { assertionTest } from "stories/assertionTestUtils"; | ||
@@ -18,0 +19,0 @@ storiesOf("Integration/ExampleTest", module) |
@@ -12,2 +12,3 @@ // @flow | ||
import { storiesOf } from "@storybook/react"; | ||
import expect from "expect"; | ||
import React from "react"; | ||
@@ -18,3 +19,3 @@ import { withScreenshot } from "storybook-chrome-screenshot"; | ||
import { clickAtOrigin, WorldviewWrapper } from "../worldviewAssertionUtils"; | ||
import { assertionTest, expect, timeout } from "stories/assertionTestUtils"; | ||
import { assertionTest, timeout } from "stories/assertionTestUtils"; | ||
@@ -21,0 +22,0 @@ const firstModelPosition = { |
@@ -12,2 +12,3 @@ // @flow | ||
import { storiesOf } from "@storybook/react"; | ||
import expect from "expect"; | ||
import React from "react"; | ||
@@ -19,3 +20,3 @@ import { withScreenshot } from "storybook-chrome-screenshot"; | ||
import { WorldviewWrapper, clickAtOrigin } from "../worldviewAssertionUtils"; | ||
import { assertionTest, expect } from "stories/assertionTestUtils"; | ||
import { assertionTest } from "stories/assertionTestUtils"; | ||
@@ -22,0 +23,0 @@ const COUNT = 6; |
@@ -12,2 +12,3 @@ // @flow | ||
import { storiesOf } from "@storybook/react"; | ||
import expect from "expect"; | ||
import React from "react"; | ||
@@ -18,3 +19,3 @@ import { withScreenshot } from "storybook-chrome-screenshot"; | ||
import { WorldviewWrapper, clickAtOrigin, WORLDVIEW_SIZE } from "../worldviewAssertionUtils"; | ||
import { assertionTest, expect, timeout } from "stories/assertionTestUtils"; | ||
import { assertionTest, timeout } from "stories/assertionTestUtils"; | ||
@@ -73,2 +74,31 @@ const cube = { | ||
.add( | ||
`Default object handler has a ray`, | ||
assertionTest({ | ||
story: (setTestData) => ( | ||
<WorldviewWrapper> | ||
<Cubes onClick={(_, clickInfo) => setTestData(clickInfo)}>{[cube]}</Cubes> | ||
</WorldviewWrapper> | ||
), | ||
assertions: async (getTestData) => { | ||
await clickAtOrigin(); | ||
const result = await getTestData(); | ||
// Dir | ||
expect(result.ray.dir[0]).toBeCloseTo(0); | ||
expect(result.ray.dir[1]).toBeCloseTo(-1); | ||
expect(result.ray.dir[2]).toBeCloseTo(0); | ||
// Origin | ||
expect(result.ray.origin[0]).toBeCloseTo(0); | ||
expect(result.ray.origin[1]).toBeCloseTo(75, 1); | ||
expect(result.ray.origin[2]).toBeCloseTo(0); | ||
// Point | ||
expect(result.ray.point[0]).toBeCloseTo(0); | ||
expect(result.ray.point[1]).toBeCloseTo(75, 1); | ||
expect(result.ray.point[2]).toBeCloseTo(0); | ||
}, | ||
}) | ||
) | ||
.add( | ||
`onMouseMove does not pick up objects with hitmapOnMouseMove=false`, | ||
@@ -75,0 +105,0 @@ assertionTest({ |
@@ -11,2 +11,3 @@ // @flow | ||
import expect from "expect"; | ||
import React, { type ComponentType } from "react"; | ||
@@ -17,3 +18,3 @@ | ||
import Worldview, { type Props } from "../Worldview"; | ||
import { assertionTest, timeout, expect } from "stories/assertionTestUtils"; | ||
import { assertionTest, timeout } from "stories/assertionTestUtils"; | ||
@@ -20,0 +21,0 @@ const defaultCameraState: $Shape<CameraState> = { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
16049
2602267
77
5