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

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,46 @@
1
+ 🟨 **Unovis** is a modular data visualization framework for React, Angular, Svelte, and vanilla TypeScript or JavaScript.
2
+
3
+ `@unovis/react` provides React components for `@unovis/ts`, which makes Unovis integration into a React
4
+ app much easier.
5
+
6
+ Learn more about **Unovis** on our website [unovis.dev](https://unovis.dev)
7
+
8
+ ## Installation
9
+ ```bash
10
+ npm install -P @unovis/ts @unovis/react
11
+ ```
12
+
13
+ ## Quick Start
14
+ ```typescript jsx
15
+ import React, { useCallback } from 'react'
16
+ import { VisXYContainer, VisLine, VisAxis } from '@unovis/react'
17
+
18
+ export type DataRecord = { x: number; y: number }
19
+ export const data: DataRecord[] = [
20
+ { x: 0, y: 0 },
21
+ { x: 1, y: 2 },
22
+ { x: 2, y: 1 },
23
+ ]
24
+
25
+ export function BasicLineChart (): JSX.Element {
26
+ return (
27
+ <VisXYContainer data={data} height={600}>
28
+ <VisLine<DataRecord>
29
+ x={useCallback(d => d.x, [])}
30
+ y={useCallback(d => d.y, [])}
31
+ ></VisLine>
32
+ <VisAxis type="x"></VisAxis>
33
+ <VisAxis type="y"></VisAxis>
34
+ </VisXYContainer>
35
+ )
36
+ }
37
+ ```
38
+
39
+ ## Documentation
40
+ https://unovis.dev/docs
41
+
42
+ ## Examples
43
+ https://unovis.dev/gallery
44
+
45
+ ## License
46
+ 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.7",
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.7",
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\n }\n\n return true\n}\n"],"names":[],"mappings":";;AAGgB,SAAA,aAAa,CAA8C,SAAoB,EAAE,SA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