Skip to content

Commit de1f96f

Browse files
committed
chore: project
1 parent 566b2b1 commit de1f96f

3 files changed

Lines changed: 409 additions & 16 deletions

File tree

packages/ui-chart/README.md

Lines changed: 191 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,86 @@
1-
2-
[![npm](https://img.shields.io/npm/v/@nativescript-community/ui-chart.svg)](https://www.npmjs.com/package/@nativescript-community/ui-chart)
3-
[![npm](https://img.shields.io/npm/dt/@nativescript-community/ui-chart.svg?label=npm%20downloads)](https://www.npmjs.com/package/@nativescript-community/ui-chart)
4-
[![GitHub forks](https://img.shields.io/github/forks/nativescript-community/ui-chart.svg)](https://github.com/nativescript-community/ui-chart/network)
5-
[![GitHub stars](https://img.shields.io/github/stars/nativescript-community/ui-chart.svg)](https://github.com/nativescript-community/ui-chart/stargazers)
6-
1+
<!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️-->
2+
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
8+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11+
DO NOT EDIT THIS READEME DIRECTLY! Edit "bluesprint.md" instead.
12+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
13+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
18+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
19+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
20+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
21+
<h1 align="center">@nativescript-community/ui-chart</h1>
22+
<p align="center">
23+
<a href="https://npmcharts.com/compare/@nativescript-community/ui-chart?minimal=true"><img alt="Downloads per month" src="https://img.shields.io/npm/dm/@nativescript-community/ui-chart.svg" height="20"/></a>
24+
<a href="https://www.npmjs.com/package/@nativescript-community/ui-chart"><img alt="NPM Version" src="https://img.shields.io/npm/v/@nativescript-community/ui-chart.svg" height="20"/></a>
25+
</p>
26+
27+
<p align="center">
28+
<b>A powerful chart / graph plugin, supporting line, bar, pie, radar, bubble, and candlestick charts as well as scaling, panning and animations.</b></br>
29+
<sub><sub>
30+
</p>
31+
32+
<br />
33+
34+
35+
36+
[](#table-of-contents)
37+
38+
## Table of Contents
39+
40+
* [Installation](#installation)
41+
* [Migration to 2.x](#migration-to-2x)
42+
* [Usage](#usage)
43+
* [Plain NativeScript](#plain-nativescript)
44+
* [XML](#xml)
45+
* [TypeScript](#typescript)
46+
* [NativeScript + Vue](#nativescript--vue)
47+
* [NativeScript + Angular](#nativescript--angular)
48+
* [About](#about)
49+
* [Examples:](#examples)
50+
* [Demos and Development](#demos-and-development)
51+
* [Repo Setup](#repo-setup)
52+
* [Build](#build)
53+
* [Demos](#demos)
54+
* [Contributing](#contributing)
55+
* [Update repo ](#update-repo-)
56+
* [Update readme ](#update-readme-)
57+
* [Update doc ](#update-doc-)
58+
* [Publish](#publish)
59+
* [modifying submodules](#modifying-submodules)
60+
* [Questions](#questions)
61+
62+
63+
64+
[](#installation)
65+
766
## Installation
867

968
- `tns plugin add @nativescript-community/ui-chart`
1069

1170
---
1271

72+
73+
[](#migration-to-2x)
74+
1375
## Migration to 2.x
1476

1577
In 2.x most methods like `setColor`/`getColor` have been changed to properties like `color`
1678
You can either to it manually and update them all (you should get tsc errors for removed or renamed methods), or you can use a regexp like `/set([A-Z])(\w*?)\(/` to search and replace (first group should be lowercase in the replace) with something like `\L$1$2=(`
1779
Then use typings to fix potential name change
1880

81+
82+
[](#usage)
83+
1984
## Usage
2085

2186
For gestures to work, make sure to add the following code block inside main application file (e.g. app.ts):
@@ -27,6 +92,9 @@ install();
2792

2893
You can also check [Wiki](https://github.com/nativescript-community/ui-chart/wiki) for any useful material.
2994

95+
96+
[](#plain-nativescript)
97+
3098
## Plain NativeScript
3199

32100
<span style="color:red">IMPORTANT: </span>Make sure you include `xmlns:ch="@nativescript-community/ui-chart"` on the Page element.
@@ -75,6 +143,9 @@ export function onLineChartLoaded(args) {
75143
}
76144
```
77145

146+
147+
[](#nativescript--vue)
148+
78149
## NativeScript + Vue
79150

80151
```javascript
@@ -126,6 +197,9 @@ onChartLoaded() {
126197
}
127198
```
128199

200+
201+
[](#nativescript--angular)
202+
129203
## NativeScript + Angular
130204
Register the element in app.module.ts
131205
```javascript
@@ -177,6 +251,9 @@ onChartLoaded(args) {
177251
}
178252
```
179253

254+
255+
[](#about)
256+
180257
## About
181258

182259
This plugin is based on [MPAndroidChart](https://github.com/PhilJay/MPAndroidChart), a powerful & easy to use chart library. Therefore, special thanks goes to Philipp Jahoda, the creator of [MPAndroidChart](https://github.com/PhilJay/MPAndroidChart) and the rest of his team.
@@ -200,7 +277,112 @@ That is because:
200277
- It can share the same data array between multiple datasets
201278
- It can still use the power of native arrays to NOT marshal arrays of positions while drawing lines with [@nativescript-community/ui-canvas](https://github.com/nativescript-community/ui-canvas)
202279

203-
## Documentation
280+
### Examples:
281+
282+
- [Basic](demo-snippets/vue/Basic.vue)
283+
- [Basic](demo-snippets/vue/BubbleChart.vue)
284+
- [Basic](demo-snippets/vue/CandleStickChart.vue)
285+
- [Basic](demo-snippets/vue/CombinedChart.vue)
286+
- [Basic](demo-snippets/vue/NSChart.vue)
287+
- [Basic](demo-snippets/vue/PieChart.vue)
288+
- [Basic](demo-snippets/vue/Realtime.vue)
289+
- [Basic](demo-snippets/vue/ScatterPlot.vue)
290+
291+
292+
[](#demos-and-development)
293+
294+
## Demos and Development
295+
296+
297+
### Repo Setup
298+
299+
The repo uses submodules. If you did not clone with ` --recursive` then you need to call
300+
```
301+
git submodule update --init
302+
```
303+
304+
The package manager used to install and link dependencies must be `pnpm` or `yarn`. `npm` wont work.
305+
306+
To develop and test:
307+
if you use `yarn` then run `yarn`
308+
if you use `pnpm` then run `pnpm i`
309+
310+
**Interactive Menu:**
311+
312+
To start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`). This will list all of the commonly used scripts.
313+
314+
### Build
315+
316+
```bash
317+
npm run build.all
318+
```
319+
WARNING: it seems `yarn build.all` wont always work (not finding binaries in `node_modules/.bin`) which is why the doc explicitly uses `npm run`
320+
321+
### Demos
322+
323+
```bash
324+
npm run demo.[ng|react|svelte|vue].[ios|android]
325+
326+
npm run demo.svelte.ios # Example
327+
```
328+
329+
Demo setup is a bit special in the sense that if you want to modify/add demos you dont work directly in `demo-[ng|react|svelte|vue]`
330+
Instead you work in `demo-snippets/[ng|react|svelte|vue]`
331+
You can start from the `install.ts` of each flavor to see how to register new demos
332+
333+
334+
[](#contributing)
335+
336+
## Contributing
337+
338+
### Update repo
339+
340+
You can update the repo files quite easily
341+
342+
First update the submodules
343+
344+
```bash
345+
npm run update
346+
```
347+
348+
Then commit the changes
349+
Then update common files
350+
351+
```bash
352+
npm run sync
353+
```
354+
Then you can run `yarn|pnpm`, commit changed files if any
355+
356+
### Update readme
357+
```bash
358+
npm run readme
359+
```
360+
361+
### Update doc
362+
```bash
363+
npm run doc
364+
```
365+
366+
### Publish
367+
368+
The publishing is completely handled by `lerna` (you can add `-- --bump major` to force a major release)
369+
Simply run
370+
```shell
371+
npm run publish
372+
```
373+
374+
### modifying submodules
375+
376+
The repo uses https:// for submodules which means you won't be able to push directly into the submodules.
377+
One easy solution is t modify `~/.gitconfig` and add
378+
```
379+
[url "ssh://git@github.com/"]
380+
pushInsteadOf = https://github.com/
381+
```
382+
383+
384+
[](#questions)
385+
386+
## Questions
204387

205-
The NativeScript 'ui-chart' plugin is based on the [MPAndroidChart](https://github.com/PhilJay/MPAndroidChart) library.
206-
In few words, its API is identical. The possibility to add API reference will be considered in the future.
388+
If you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).

0 commit comments

Comments
 (0)