You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44-31Lines changed: 44 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,30 +4,46 @@
4
4
5
5
**GUI 4 Vega** is a React component library that provides a user-friendly interface for creating and customizing [Vega](https://vega.github.io/vega/) visualizations.
6
6
7
-
Refer to this README or [GUI 4 Vega Documentation](https://relisa.github.io/Vega-GUI/).
7
+
Refer either to this README or [GUI 4 Vega Documentation](https://relisa.github.io/Vega-GUI/).
8
8
9
9
## Features
10
-
11
10
-**React Component**: Easy integration into any React project via `@relisa/gui4vega` package hosted on GitHub Packages registry.
12
11
-**UI Frameworks Integration**: Examples provided for [Ant Design](https://ant.design/) (`demo_antd`) and [Bootstrap](https://react-bootstrap.netlify.app/) (`demo_bootstrap`).
13
12
-**Embedded Text Editor**: Interactive JSON editor powered by [CodeMirror](https://codemirror.net/).
14
13
-**Wizard Tab**: Step-by-step interface to easily generate sample visualizations and configure simple graphs.
15
-
-**Data and Signals Editors**: Interactive UI panels to visually manage, inspect, and tweak Vega data sources and signals without writing JSON manually.
16
-
-**Spec Import and Export**: Easily load existing Vega JSON specifications or export your creations for use in other projects.
17
-
-**Data Import**: Built-in support for CSV and JSON data importing.
18
-
-**Live Preview**: Real-time updates to the Vega visualization as you edit the specification.
19
-
-**Customizable Layout**: Layout with resizable panels for the editor and visualization, supporting light and dark themes.
14
+
-**Data and Signals Editors**: Panels to visually manage, inspect, and tweak Vega data sources and signals without writing JSON manually.
15
+
-**Spec Import and Export**: Load existing Vega JSON specifications or export your creations for use in other projects.
16
+
-**Data Import**: Built-in support for CSV and JSON data import via [Papa Parse](https://www.papaparse.com/).
17
+
-**Customizable Layout**: Layout with resizable panels for the editor and visualization, supporting light and dark themes via Ant Design GlobalToken.
20
18
21
19

22
20
23
-
## Contents
24
-
25
21
## Requirements
26
-
27
22
- Node.js >= 18.x
28
23
- React >= 18.2.0, 19.0.0
29
24
- React DOM >= 18.2.0, 19.0.0
30
25
26
+
## Run demo applications
27
+
Since the demo applications are linked locally to the library, you need to build the library first before running the demos:
28
+
29
+
```bash
30
+
# from root of the repository
31
+
cd gui4vega
32
+
npm install
33
+
npm run build
34
+
```
35
+
36
+
After building the library, you can run either of the demo applications (you dont need to link the library to the demo applications, since they are already linked locally in the repository):
37
+
38
+
```bash
39
+
# from root of the repository
40
+
cd demo_antd # or demo_bootstrap
41
+
npm install
42
+
npm run dev
43
+
```
44
+
45
+
The applications will be available at `http://localhost:5173` or `http://localhost:5174` respectively.
46
+
31
47
## Installation
32
48
These steps will guide you through the installation of the GUI 4 Vega package in order to include it in your React project.
33
49
@@ -70,7 +86,7 @@ To install the package, you need access to the GitHub Packages registry.
70
86
- The `.npmrc` file is also present in the repository.
71
87
- You can also refer to the [GitHub documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry) for more details about GitHub Packages.
@@ -81,30 +97,27 @@ To install the package, you need access to the GitHub Packages registry.
81
97
npm install @relisa/gui4vega
82
98
```
83
99
84
-
## User Guide
100
+
## Importing the Component
101
+
To use GUI 4 Vega in your application, simply import the component `VegaEditor` from the package. To access its code via `getCode()` method, you should provide it with a React reference (`ref`).
85
102
86
-
### Run demo applications
87
-
Since the demo applications are linked locally to the library, you need to build the library first before running the demos:
// Create a ref to interact with the VegaEditor instance
110
+
// You can access the getCode() method through this ref
111
+
const editorRef =useRef<VegaEditorRef>(null);
95
112
96
-
After building the library, you can run either of the demo applications (you dont need to link the library to the demo applications, since they are already linked locally in the repository):
113
+
return (
114
+
<VegaEditorref={editorRef} height='700px'/>
115
+
);
116
+
};
97
117
98
-
```bash
99
-
# from root of the repository
100
-
cd demo_antd # or demo_bootstrap
101
-
npm install
102
-
npm run dev
118
+
exportdefaultApp;
103
119
```
104
120
105
-
The applications will be available at `http://localhost:5173` or `http://localhost:5174` respectively.
106
-
107
-
### Editor
108
-
The GUI provides an integrated code editor for updating the Vega visualization specification JSON. Changes to the code automatically reflect on the rendered chart.
121
+
---
109
122
110
-
## Known Issues and Limitations
123
+
If you would like to access exported data from the editor in your code, consider using the `ExternalSelectionExporter` component. For its usage, refer to the [GUI 4 Vega Documentation](https://relisa.github.io/Vega-GUI/) or [implementation of demo_antd](https://relisa.github.io/Vega-GUI/), which includes an example of how to use it.
0 commit comments