Skip to content

Commit 9a4f12e

Browse files
Changed build tool to vite. Upgraded react to version 18.
1 parent 697f9c4 commit 9a4f12e

File tree

175 files changed

+2882
-3301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+2882
-3301
lines changed

.eslintrc.json

-6
This file was deleted.

.gitignore

+22-33
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,25 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
7-
8-
# testing
9-
/coverage
10-
11-
# next.js
12-
/.next/
13-
/out/
14-
15-
# production
16-
/build
17-
/dist
18-
19-
# misc
20-
.DS_Store
21-
*.pem
22-
23-
# debug
1+
# Logs
2+
logs
3+
*.log
244
npm-debug.log*
255
yarn-debug.log*
266
yarn-error.log*
27-
28-
# local env files
29-
.env*.local
30-
31-
# vercel
32-
.vercel
33-
34-
# typescript
35-
*.tsbuildinfo
36-
next-env.d.ts
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
output
13+
dist-ssr
14+
*.local
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?

.npmignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
/public
44
/docs
55
/src
6-
/.next
6+
/output
77
.gitignore
8+
create-react-app-readme.md
9+
package-lock.json
810
yarn.lock
911
.vscode
1012
*.log

README.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,18 @@ Data visualization diagramming components library for dependencies visualization
1010

1111
## React Example
1212

13-
```bash
14-
yarn create next-app test1
13+
```
14+
yarn create vite test1 --template react
1515
cd test1
1616
1717
yarn add basicprimitivesreact
1818
1919
yarn dev
2020
```
2121

22-
Add following changes into src/app/page.js.
22+
Add following changes into App.js
2323

2424
``` JavaScript
25-
'use client';
2625
import React from 'react';
2726
import { OrgDiagram } from 'basicprimitivesreact';
2827
import { PageFitMode, Enabled } from 'basicprimitives';
@@ -86,7 +85,7 @@ export default App;
8685
* No dependencies on 3rd party libraries.
8786
* Webpack [Tree Shaking](https://webpack.js.org/guides/tree-shaking/) support
8887

89-
### Basic Primitives Diagrams for [React Sample](https://reactjs.org/)
88+
### Basic Primitives Diagrams for [React](https://reactjs.org/)
9089
* User [JSX](https://reactjs.org/docs/introducing-jsx.html) templates
9190
* 100% [Virtual DOM](https://reactjs.org/docs/faq-internals.html) rendering cycle
9291
* [react-dnd](http://react-dnd.github.io/react-dnd/about) & [React Context](https://reactjs.org/docs/context.html) compatible
@@ -153,6 +152,6 @@ Do you want to use a Basic Primitives diagram for a personal website, a school s
153152
## Performance
154153
Through a full API, you can add, remove and modify individual items and their properties. The component will only update the visual elements affected by the API changes. We put in much effort to make it happen!
155154

156-
Copyright (c) 2013 - 2023 Basic Primitives Inc
155+
Copyright (c) 2013 - 2024 Basic Primitives Inc
157156
* [Non-commercial - Free](http://creativecommons.org/licenses/by-nc/3.0/)
158157
* [Commercial and government licenses](license.pdf)

docs/AddingNewItemsToChartAtRuntime.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ The component ignores changes in node options, not affecting the diagram layout.
1010

1111
The application stores the collection of items in the application component: `state`. The diagram component updates its layout every time it gets a new configuration object reference. The diagram keeps the internal state between rendering cycles and tracks property changes for individual configuration objects. The configuration object properties may affect different visuals and transformations of the graph. The component tracks every property individually and optimizes rendering time. For the more complex implementation of chart editing functionality, see the matrixed organizational chart structure editor demo at this site.
1212

13-
[React Sample](../src/components/Samples/AddingNewItemsToChartAtRuntime.js)
13+
[React](../src/Samples/AddingNewItemsToChartAtRuntime.jsx)

docs/AdviserAndAssistantItemTypes.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ Use the `adviserPlacementType` option to place an adviser or assistant on the pa
2121

2222
Use the `levelOffset` option to arrange assistants into multiple rows. See the regular children layout sample.
2323

24-
[React Sample](../src/components/Samples/AdviserAndAssistantItemTypes.js)
24+
[React](../src/Samples/AdviserAndAssistantItemTypes.jsx)
2525

2626
## Sub Adviser & Sub Assistant item types
2727

2828
Sub Adviser & Sub Assistant item types are variations of regular Adviser & Assistant types. The only difference is that they have the connection line going from the top edge of the node, and they are shift down one level relative to their parents.
2929

3030
Use the `adviserPlacementType` option to place them on the parent's hierarchy's left or right side.
3131

32-
[React Sample](../src/components/Samples/SubAdviserAndSubAssistantItemTypes.js)
32+
[React](../src/Samples/SubAdviserAndSubAssistantItemTypes.jsx)
3333

3434
## Adviser child nodes placement above parent's node children
3535

3636
If the adviser node has its children, then control adds extra levels, so it places advisers children at rows above the parent's children. You can alter this layout schema with the `placeAdvisersAboveChildren` option. If you set it to false, control would place advisers and the parent's children at the same row of the diagram.
3737

38-
[React Sample](../src/components/Samples/PlaceAdvisersAboveChildren.js)
38+
[React](../src/Samples/PlaceAdvisersAboveChildren.jsx)
3939

4040
## Assistant child nodes placement above parent's node children
4141
If the assistant node has its children, then control pushes the parent's children down, placing assistant children at rows above the parent's children. You can alter this layout schema with the `placeAssistantsAboveChildren` option. If you set it to false, then the parent's and assistant's node children would be rendered side by side at the same level.
4242

43-
[React Sample](../src/components/Samples/PlaceAssistantsAboveChildren.js)
43+
[React](../src/Samples/PlaceAssistantsAboveChildren.jsx)

docs/Buttons.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { Enabled } from basicprimitives;
3131
parent: null,
3232
title: "James Smith",
3333
description: "VP, Public Sector",
34-
image: "/react/photos/a.png",
34+
image: "./photos/a.png",
3535
hasButtons: Enabled.True
3636
}
3737
]
@@ -88,4 +88,4 @@ import { OrgDiagram } from basicprimitivesreact;
8888
/>
8989
```
9090

91-
[React Sample](../src/components/Samples/ButtonsPanel.js)
91+
[React](../src/Samples/ButtonsPanel.jsx)

docs/ChildrenLayout.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ import { ChildrenPlacementType } from basicprimitives;
1818
parent: null,
1919
title: "James Smith",
2020
description: "VP, Public Sector",
21-
image: "/react/photos/a.png",
21+
image: "./photos/a.png",
2222
childrenPlacementType: ChildrenPlacementType.Matrix // Individually
2323
}
2424
]
2525
}
2626
/>
2727
```
2828

29-
[React Sample](../src/components/Samples/ChildrenPlacementType.js)
29+
[React](../src/Samples/ChildrenPlacementType.jsx)
3030

3131
# Placing children into multiple horizontal levels
3232
To programmatically place children nodes into multiple rows, use the `levelOffset` property. Child nodes would be grouped by that property and placed in rows. If level offsets defined for children have gaps, then the control would preserve empty row, so different branches and teams of the same organizations would be properly aligned. See the matrixed layout demo for the matrixed team structure in the organization.
@@ -44,28 +44,28 @@ import { ChildrenPlacementType } from basicprimitives;
4444
parent: null,
4545
title: "James Smith",
4646
description: "VP, Public Sector",
47-
image: "/react/photos/a.png",
47+
image: "./photos/a.png",
4848
childrenPlacementType: ChildrenPlacementType.Horizontal
4949
},
5050
{
5151
id: 2,
5252
parent: 1,
5353
title: "James Smith",
5454
description: "VP, Public Sector",
55-
image: "/react/photos/a.png",
55+
image: "./photos/a.png",
5656
levelOffset: 0
5757
},
5858
{
5959
id: 3,
6060
parent: 1,
6161
title: "James Smith",
6262
description: "VP, Public Sector",
63-
image: "/react/photos/a.png",
63+
image: "./photos/a.png",
6464
levelOffset: 1
6565
}
6666
]
6767
}
6868
/>
6969
```
7070

71-
[React Sample](../src/components/Samples/ChildrenAndAssistantsLevelOffset.js)
71+
[React](../src/Samples/ChildrenAndAssistantsLevelOffset.jsx)

docs/ConnectorAnnotation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ In general shape of connector annotation may indicate various relations, so comp
1717
## Labels
1818
Connector annotations labels are plain text or JSX elements. Please, pay attention that component does not resolve connector annotations labels overlapping, so many annotations labels can clutter view and diagram in general.
1919

20-
[React Sample](../src/components/Samples/ConnectorAnnotation.js)
20+
[React](../src/Samples/ConnectorAnnotation.jsx)

docs/CrossBranchAlignment.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ The following options control cross-branch nodes alignment:
66
* `alignBranches` - property enables alignment
77
* `placeAdvisersAboveChildren` - if this property is disabled, then advisers' children are placed at the same level and aligned to the children of the parent's node.
88

9-
[React Sample](../src/components/Samples/CrossBranchAlignment.js)
9+
[React](../src/Samples/CrossBranchAlignment.jsx)
1010

docs/CursorTemplate.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ Every time we select a cursor node, the control recalculates the layout, which t
3838
## Custom cursor template border
3939
The following example demonstrates how to create a custom cursor border having item specific color and tag element.
4040

41-
[React Sample](../src/components/Samples/CursorTemplate.js)
41+
[React](../src/Samples/CursorTemplate.jsx)
4242

docs/CustomLayoutWithInvisibleItems.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { OrgDiagram } from basicprimitivesreact;
1212
parent: null,
1313
title: "James Smith",
1414
description: "VP, Public Sector",
15-
image: "/react/photos/a.png",
15+
image: "./photos/a.png",
1616
isVisible: false
1717
}
1818
]
@@ -22,13 +22,13 @@ import { OrgDiagram } from basicprimitivesreact;
2222

2323
See custom item types, children layout, and inactive items samples as well.
2424

25-
[React Sample](../src/components/Samples/CustomLayoutWithInvisibleItems.js)
25+
[React](../src/Samples/CustomLayoutWithInvisibleItems.jsx)
2626

2727
## Skipped Levels
2828

2929
We can use hidden items to skip levels in the organizational chart as well. The hidden nodes occupy space, so we can use them to shift child items down one row relative to their parents.
3030

3131
Use the `levelOffset` option of the item configuration object to arrange regular children into rows.
3232

33-
[React Sample](../src/components/Samples/SkippedLevels.js)
33+
[React](../src/Samples/SkippedLevels.jsx)
3434

docs/DiagramSizing.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The following sample uses CSS @Media rules to control the diagram size on the pa
2222

2323
See [CSS @Media](https://developer.mozilla.org/en-US/docs/Web/CSS/@media) for more reference
2424

25-
[React Sample](../src/components/Samples/PageSizeDiagram.js)
25+
[React](../src/Samples/PageSizeDiagram.jsx)
2626

2727
## Auto size diagram in the article
2828
Another diagram integration scenario is diagram placement inside the article, so the component needs to auto expand its size to accommodate all diagram nodes without minimization or truncation. Set `pageFitMode` to `PageFitMode.AutoSize` and component will size itself to show all nodes of diagram.
@@ -44,4 +44,4 @@ import { Size } from basicprimitives;
4444
}} />
4545
```
4646

47-
[React Sample](../src/components/Samples/AutoSize.js)
47+
[React](../src/Samples/AutoSize.jsx)

docs/DragNDrop.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ The following example shows Drag & Drop functionality between diagram items and
3939
* [useDrop](https://react-dnd.github.io/react-dnd/docs/api/use-drop)
4040

4141

42-
[React Sample](../src/components/Samples/DragNDropHooks.js)
42+
[React](../src/Samples/DragNDropHooks.jsx)
4343

4444
## Drag & Drop diagram nodes to other components
4545

46-
[React Sample](../src/components/Samples/DragToTrashBinHooks.js)
46+
[React](../src/Samples/DragToTrashBinHooks.jsx)

docs/FamilyChartItemsOrdering.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ Please, pay attention that control ignores looped references between nodes, so i
1313

1414
## Family Items Ordering Sample
1515

16-
[React Sample](../src/components/Samples/FamilyChartItemsOrdering.js)
16+
[React](../src/Samples/FamilyChartItemsOrdering.jsx)
1717

1818
## Multiple Families Ordering Sample
1919

20-
[React Sample](../src/components/Samples/MultipleFamiliesOrdering.js)
20+
[React](../src/Samples/MultipleFamiliesOrdering.jsx)
2121

2222
## Primary Parent
2323

2424
If a node has multiple parents and belongs to distant branches of the diagram, then the `primaryParent` property can give higher priority to one of them. So the control would place the node to the hierarchy of that primary parent.
2525

2626
* `primaryParent` - defines the primary parent of the node. The control would place the node into the hierarchy of the primary node. If there is no parent found, then the layout engine will ignore it.
2727

28-
[React Sample](../src/components/Samples/FamilyChartPrimaryParent.js)
28+
[React](../src/Samples/FamilyChartPrimaryParent.jsx)

docs/FamilyConnectorsVisualization.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { FamDiagram } from basicprimitivesreact;
1818
/>
1919
```
2020

21-
[React Sample](../src/components/Samples/MatrixLayoutInFamilyChart.js)
21+
[React](../src/Samples/MatrixLayoutInFamilyChart.jsx)
2222

2323
Another typical problem in connectors visualization is excessive grandparents relations. It is the situation when an item has direct links to all its grandparents. Usually, when we draw the family diagram, we are more interested in showing dependencies over actual relations. We know that the grandparent precedes the parent, the great grandparent precedes the grandparent, and so on. So this precedence defines the indirect link between the child node and grand-grandparent. So direct relation visualization between the child node and its grandparents can be omitted from the diagram and replaced with dynamic annotations. Look at the following example where every child references all preceding parents:
2424

@@ -34,6 +34,6 @@ import { FamDiagram } from basicprimitivesreact;
3434
/>
3535
```
3636

37-
[React Sample](../src/components/Samples/FamilyHideGrandParentsConnections.js)
37+
[React](../src/Samples/FamilyHideGrandParentsConnections.jsx)
3838

3939
So we got a relatively clean relations diagram between nodes. We still have all relations in place. The only difference is that grandparent's connections go through actual parents, so we need to visualize them dynamically with highlight path annotations. As we browse the diagram nodes, we can highlight all directly linked parents and children with Connector Path Annotations and set dynamically custom Item Template for them.

docs/FirstFamilyChart.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Basic Primitives Diagrams for React - data visualization component library that implements organizational chart and layered multi-parent dependency tree diagrams. It renders nodes using ReactJS Virtual DOM without direct DOM manipulations, so it compliant with all React features and popular react extensions like [React Drag & Drop](http://react-dnd.github.io/react-dnd/about) and [React Context](https://reactjs.org/docs/context.html)
44

5-
Our site contains samples and demo published on GitHub. The recommended way to get familiar with our library is to clone our GitHub [React Sample](https://github.com/BasicPrimitives/react) repository and run it locally. It contains simple, single-page examples. If you need to see more complex end to end applications developed in ReactJS using hooks and Redux state management, then clone our GitHub [react-demos](https://github.com/BasicPrimitives/react-demo) repository
5+
Our site contains samples and demo published on GitHub. The recommended way to get familiar with our library is to clone our GitHub [react](https://github.com/BasicPrimitives/react) repository and run it locally. It contains simple, single-page examples. If you need to see more complex end to end applications developed in ReactJS using hooks and Redux state management, then clone our GitHub [react-demos](https://github.com/BasicPrimitives/react-demo) repository
66

77

88
## Organizational chart vs. Family Diagram
@@ -25,7 +25,7 @@ You can guide the family diagram control on how to order nodes in layout relativ
2525

2626
The following is the copy-paste of the "First Organization Chart" sample, but for the family diagram. See the organizational chart sample for more technical details.
2727

28-
[React Sample](../src/components/Samples/FirstFamilyChart.js)
28+
[React](../src/Samples/FirstFamilyChart.jsx)
2929

3030
## Create React App Sample
3131

docs/FirstOrganizationalChart.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Basic Primitives Diagrams for React - data visualization component library that implements organizational chart and multi-parent dependency tree diagrams. It renders nodes using ReactJS Virtual DOM without direct DOM manipulations, so it compliant with all React features and popular react extensions like [React Drag & Drop](http://react-dnd.github.io/react-dnd/about) and [React Context](https://reactjs.org/docs/context.html)
44

5-
Our site contains samples and demo published on GitHub. The recommended way to get familiar with our library is to clone our GitHub [React Sample](https://github.com/BasicPrimitives/react) repository and run it locally. It contains simple, single-page examples. If you need to see more complex end to end applications developed in ReactJS using hooks and Redux state management, then clone our GitHub [react-demos](https://github.com/BasicPrimitives/react-demo) repository
5+
Our site contains samples and demo published on GitHub. The recommended way to get familiar with our library is to clone our GitHub [react](https://github.com/BasicPrimitives/react) repository and run it locally. It contains simple, single-page examples. If you need to see more complex end to end applications developed in ReactJS using hooks and Redux state management, then clone our GitHub [react-demos](https://github.com/BasicPrimitives/react-demo) repository
66

77
## NPM packages:
88
Use the following commands to import our components from npm packages.
@@ -14,7 +14,7 @@ import { Enabled, PageFitMode } from 'basicprimitives';
1414
* `basicprimitivesreact` - react components
1515
* `basicprimitives` - the core of the library which contains common configuration objects and enumerations.
1616

17-
[React Sample](../src/components/Samples/FirstOrganizationalChart.js)
17+
[React](../src/Samples/FirstOrganizationalChart.jsx)
1818

1919
## Create React App Sample
2020
The diagramming components work in React applications created with [`create-react-app`](https://facebook.github.io/create-react-app/), use the following steps to create and run the first diagram:

docs/HighlightPathAnnotation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ import { LineType, Colors } from basicprimitives;
1414
}
1515
/>
1616
```
17-
[React Sample](../src/components/Samples/HighlightPathAnnotation.js)
17+
[React](../src/Samples/HighlightPathAnnotation.jsx)
1818

1919
## PERT - Program evaluation and review technique chart & Critical Path Visualization
2020
PERT chart critical path visualization with Highlight Path Annotation. The chart does not provide any means to find a critical path. It is the developer's responsibility to trace items and visualize critical path with Highlight Path Annotation. The application should sequence the Critical path nodes and set them in the annotation.
2121

22-
[React Sample](../src/components/Samples/PERTChart.js)
22+
[React](../src/Samples/PERTChart.jsx)
2323

2424
## Routing Highlight Path Annotation for hidden grandparents connections
2525

@@ -33,4 +33,4 @@ import { FamDiagram } from basicprimitivesreact;
3333
/>
3434
```
3535

36-
[React Sample](../src/components/Samples/FamilyHideGrandParentsConnections.js)
36+
[React](../src/Samples/FamilyHideGrandParentsConnections.jsx)

docs/HighlightTemplate.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ import { OrgDiagram } from basicprimitivesreact;
2929
## Custom highlight template border
3030
The following example demonstrates how to create a custom highlight border having item dependent color and tag element.
3131

32-
[React Sample](../src/components/Samples/HighlightTemplate.js)
32+
[React](../src/Samples/HighlightTemplate.jsx)

0 commit comments

Comments
 (0)