@unovis/react 1.0.0-beta.6 → 1.0.0-beta.8

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 ADDED
@@ -0,0 +1,48 @@
1
+ ![cover](https://user-images.githubusercontent.com/755708/194946760-13db0396-c429-4abb-8324-a5efae0455e2.png)
2
+
3
+ 🟨 **Unovis** is a modular data visualization framework for React, Angular, Svelte, and vanilla TypeScript or JavaScript.
4
+
5
+ `@unovis/react` provides React components for `@unovis/ts`, which makes Unovis integration into a React
6
+ app much easier.
7
+
8
+ Learn more about **Unovis** on our website [unovis.dev](https://unovis.dev)
9
+
10
+ ## Installation
11
+ ```bash
12
+ npm install -P @unovis/ts @unovis/react
13
+ ```
14
+
15
+ ## Quick Start
16
+ ```typescript jsx
17
+ import React, { useCallback } from 'react'
18
+ import { VisXYContainer, VisLine, VisAxis } from '@unovis/react'
19
+
20
+ export type DataRecord = { x: number; y: number }
21
+ export const data: DataRecord[] = [
22
+ { x: 0, y: 0 },
23
+ { x: 1, y: 2 },
24
+ { x: 2, y: 1 },
25
+ ]
26
+
27
+ export function BasicLineChart (): JSX.Element {
28
+ return (
29
+ <VisXYContainer data={data} height={600}>
30
+ <VisLine<DataRecord>
31
+ x={useCallback(d => d.x, [])}
32
+ y={useCallback(d => d.y, [])}
33
+ ></VisLine>
34
+ <VisAxis type="x"></VisAxis>
35
+ <VisAxis type="y"></VisAxis>
36
+ </VisXYContainer>
37
+ )
38
+ }
39
+ ```
40
+
41
+ ## Documentation
42
+ https://unovis.dev/docs
43
+
44
+ ## Examples
45
+ https://unovis.dev/gallery
46
+
47
+ ## License
48
+ Apache-2.0
package/package.json CHANGED
@@ -1,7 +1,29 @@
1
1
  {
2
2
  "name": "@unovis/react",
3
- "version": "1.0.0-beta.6",
4
- "description": "React wrapper for Unovis",
3
+ "description": "Modular data visualization framework for React, Angular, Svelte, and vanilla TypeScript or JavaScript",
4
+ "version": "1.0.0-beta.8",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/f5/unovis.git",
8
+ "directory": "packages/react"
9
+ },
10
+ "homepage": "https://unovis.dev",
11
+ "bugs": {
12
+ "url": "https://github.com/f5/unovis/issues"
13
+ },
14
+ "keywords": [
15
+ "react",
16
+ "data visualization",
17
+ "maps",
18
+ "charts",
19
+ "graphs"
20
+ ],
21
+ "author": "Nikita Rokotyan, F5 Inc. <nikita@f5.com> (https://rokotyan.com)",
22
+ "maintainers": [
23
+ "Nikita Rokotyan <nikita@f5.com> (https://rokotyan.com)",
24
+ "Rebecca Bol <r.bol@f5.com>"
25
+ ],
26
+ "license": "Apache-2.0",
5
27
  "main": "./index.js",
6
28
  "types": "./index.d.ts",
7
29
  "type": "module",
@@ -10,13 +32,11 @@
10
32
  "build": "rimraf dist && tsc --project tsconfig.lib.json --emitDeclarationOnly && rollup --config",
11
33
  "tsc": "tsc",
12
34
  "generate": "rollup -c ./autogen/rollup.config.js; node .autogen.cjs; rm .autogen.cjs",
13
- "publish-dist": "cp ./package.json ./dist; cp ../../LICENSE ./dist; cd ./dist; npm publish; rm -rf .cache"
35
+ "publish-dist": "cp ./{LICENSE,README.md,package.json} ./dist; cd ./dist; npm publish; rm -rf .cache"
14
36
  },
15
- "author": "Nikita Rokotyan",
16
- "license": "Apache-2.0",
17
37
  "peerDependencies": {
18
38
  "@emotion/css": "^11.7.1",
19
- "@unovis/ts": "1.0.0-beta.6",
39
+ "@unovis/ts": "1.0.0-beta.8",
20
40
  "react": ">=16.8.0",
21
41
  "react-dom": ">=16.8.0"
22
42
  },
@@ -38,6 +58,6 @@
38
58
  "typescript": "~4.2.4"
39
59
  },
40
60
  "dependencies": {
41
- "lodash": "^4.17.21"
61
+ "lodash-es": "^4.17.21"
42
62
  }
43
63
  }
package/utils/react.js CHANGED
@@ -1,4 +1,4 @@
1
- import _isEqual from 'lodash/isEqual.js';
1
+ import _isEqual from 'lodash-es/isEqual.js';
2
2
 
3
3
  function arePropsEqual(prevProps, nextProps) {
4
4
  if (typeof prevProps.children !== typeof nextProps.children)
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sources":["../../src/utils/react.ts"],"sourcesContent":["import { ReactElement, ReactNode, ReactChild, ReactFragment } from 'react'\nimport _isEqual from 'lodash/isEqual.js'\n\nexport function arePropsEqual<PropTypes extends { children?: ReactNode }> (prevProps: PropTypes, nextProps: PropTypes): boolean {\n if (typeof prevProps.children !== typeof nextProps.children) return false\n\n if (Array.isArray(prevProps.children) && Array.isArray(nextProps.children)) {\n const prevChildren = prevProps.children as ReactElement[]\n const nextChildren = nextProps.children as ReactElement[]\n if (prevChildren.length !== nextChildren.length) return false\n\n for (let i = 0; i < nextChildren.length; i += 1) {\n if (!_isEqual(prevChildren[i].props, nextChildren[i].props)) return false\n }\n }\n\n const propKeys = Array.from(new Set([...Object.keys(prevProps), ...Object.keys(nextProps)])) as (keyof PropTypes)[]\n for (const key of propKeys) {\n if (key === 'children') continue\n if (!(_isEqual(prevProps[key], nextProps[key]))) return false\n }\n\n return true\n}\n"],"names":[],"mappings":";;AAGgB,SAAA,aAAa,CAA8C,SAAoB,EAAE,SAAoB,EAAA;IACnH,IAAI,OAAO,SAAS,CAAC,QAAQ,KAAK,OAAO,SAAS,CAAC,QAAQ;AAAE,QAAA,OAAO,KAAK,CAAA;AAEzE,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;AAC1E,QAAA,MAAM,YAAY,GAAG,SAAS,CAAC,QAA0B,CAAA;AACzD,QAAA,MAAM,YAAY,GAAG,SAAS,CAAC,QAA0B,CAAA;AACzD,QAAA,IAAI,YAAY,CAAC,MAAM,KAAK,YAAY,CAAC,MAAM;AAAE,YAAA,OAAO,KAAK,CAAA;AAE7D,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;AAC/C,YAAA,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAAE,gBAAA,OAAO,KAAK,CAAA;AAC1E,SAAA;AACF,KAAA;AAED,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAwB,CAAA;AACnH,IAAA,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE;QAC1B,IAAI,GAAG,KAAK,UAAU;YAAE,SAAQ;AAChC,QAAA,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,KAAK,CAAA;AAC9D,KAAA;AAED,IAAA,OAAO,IAAI,CAAA;AACb;;;;"}
1
+ {"version":3,"file":"react.js","sources":["../../src/utils/react.ts"],"sourcesContent":["import { ReactElement, ReactNode } from 'react'\nimport _isEqual from 'lodash-es/isEqual.js'\n\nexport function arePropsEqual<PropTypes extends { children?: ReactNode }> (prevProps: PropTypes, nextProps: PropTypes): boolean {\n if (typeof prevProps.children !== typeof nextProps.children) return false\n\n if (Array.isArray(prevProps.children) && Array.isArray(nextProps.children)) {\n const prevChildren = prevProps.children as ReactElement[]\n const nextChildren = nextProps.children as ReactElement[]\n if (prevChildren.length !== nextChildren.length) return false\n\n for (let i = 0; i < nextChildren.length; i += 1) {\n if (!_isEqual(prevChildren[i].props, nextChildren[i].props)) return false\n }\n }\n\n const propKeys = Array.from(new Set([...Object.keys(prevProps), ...Object.keys(nextProps)])) as (keyof PropTypes)[]\n for (const key of propKeys) {\n if (key === 'children') continue\n if (!(_isEqual(prevProps[key], nextProps[key]))) return false\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