mathbox-react 0.0.13 → 0.0.14-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/package.json +6 -1
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Mathbox React
|
|
2
|
+
|
|
3
|
+
React bindings for [Mathbox](https://github.com/unconed/mathbox).
|
|
4
|
+
|
|
5
|
+
## Example
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import React from "react"
|
|
9
|
+
import { ContainedMathbox, Axis, Grid, Cartesian } from "mathbox-react"
|
|
10
|
+
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls"
|
|
11
|
+
|
|
12
|
+
const SimpleExample: React.FC = () => (
|
|
13
|
+
<ContainedMathbox
|
|
14
|
+
options={{
|
|
15
|
+
plugins: ["core", "controls", "cursor"],
|
|
16
|
+
controls: { klass: OrbitControls },
|
|
17
|
+
}}
|
|
18
|
+
containerStyle={{ height: "100vh" }}
|
|
19
|
+
>
|
|
20
|
+
<Cartesian>
|
|
21
|
+
<Axis axis="x" color="orange" />
|
|
22
|
+
<Axis axis="y" color="blue" />
|
|
23
|
+
<Axis axis="z" color="green" />
|
|
24
|
+
<Grid axes="xz" />
|
|
25
|
+
</Cartesian>
|
|
26
|
+
</ContainedMathbox>
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
export default SimpleExample
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Development
|
|
33
|
+
The project uses [Yarn](https://yarnpkg.com/getting-started/install) and includes two [Yarn Workspaces](https://yarnpkg.com/features/workspaces):
|
|
34
|
+
- [mathbox-react](./mathbox-react/) The actual package code, pbulished to NPM
|
|
35
|
+
- [examples](./example/) Examples using `mathbox-react`.
|
|
36
|
+
|
|
37
|
+
See individual `package.json` files for available commands. In general, commands should be run via `yarn`, not `npm`. E.g., `yarn install` or `yarn lint`.
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mathbox-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14-rc1",
|
|
4
4
|
"description": "React wrapper for Mathbox",
|
|
5
5
|
"license": "ISC",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/ChristopherChudzicki/mathbox-react",
|
|
9
|
+
"directory": "mathbox-react"
|
|
10
|
+
},
|
|
6
11
|
"author": "Chris Chudzicki",
|
|
7
12
|
"main": "build/cjs/index.js",
|
|
8
13
|
"module": "build/esm/index.js",
|