Skip to content

Commit 333d2cc

Browse files
committed
LCJS 4.0.1
1 parent c62aa7c commit 333d2cc

11 files changed

+155
-136
lines changed

.github/workflows/gh-pages-deploy.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@ name: Webpack build to GitHub Pages
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66

77
jobs:
88
build:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v2
1313

14-
- name: Use Node.js 16.x
15-
uses: actions/setup-node@v1
16-
with:
17-
node-version: '16.x'
14+
- name: Use Node.js 16.x
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: "16.x"
1818

19-
- name: Build
20-
run: |
21-
npm install
22-
npm run build
19+
- name: Build
20+
run: |
21+
npm install
22+
npm run build
2323
24-
- name: Deploy
25-
uses: peaceiris/actions-gh-pages@v3
26-
with:
27-
github_token: ${{ secrets.GITHUB_TOKEN }}
28-
publish_dir: ./dist
29-
publish_branch: gh-pages
24+
- name: Deploy
25+
uses: peaceiris/actions-gh-pages@v3
26+
with:
27+
github_token: ${{ secrets.GITHUB_TOKEN }}
28+
publish_dir: ./dist
29+
publish_branch: gh-pages

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 LightningChart Ltd.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# JavaScript Pyramid Chart
22

3-
![JavaScript Pyramid Chart](simplePyramid.png)
3+
![JavaScript Pyramid Chart](simplePyramid-darkGold.png)
44

55
This demo application belongs to the set of examples for LightningChart JS, data visualization library for JavaScript.
66

77
LightningChart JS is entirely GPU accelerated and performance optimized charting library for presenting massive amounts of data. It offers an easy way of creating sophisticated and interactive charts and adding them to your website or web application.
88

99
The demo can be used as an example or a seed project. Local execution requires the following steps:
1010

11-
- Make sure that relevant version of [Node.js](https://nodejs.org/en/download/) is installed
12-
- Open the project folder in a terminal:
11+
- Make sure that relevant version of [Node.js](https://nodejs.org/en/download/) is installed
12+
- Open the project folder in a terminal:
1313

14-
npm install # fetches dependencies
15-
npm start # builds an application and starts the development server
14+
npm install # fetches dependencies
15+
npm start # builds an application and starts the development server
1616

17-
- The application is available at *http://localhost:8080* in your browser, webpack-dev-server provides hot reload functionality.
17+
- The application is available at _http://localhost:8080_ in your browser, webpack-dev-server provides hot reload functionality.
1818

1919

2020
## Description
@@ -33,7 +33,9 @@ By default, the LabelsOnSides type is used.
3333

3434
```javascript
3535
// Create a new Pyramid Chart and pass the type to use when placing labels.
36-
const pyramid = lightningChart().Pyramid( { type: PyramidChartTypes.LabelsOnSides } )
36+
const pyramid = lightningChart().Pyramid({
37+
type: PyramidChartTypes.LabelsOnSides,
38+
})
3739
```
3840

3941
After creating the Pyramid Chart, we can populate it by adding slices to it.
@@ -43,52 +45,54 @@ You can alternatively add multiple slices as an array of objects containing a na
4345

4446
```javascript
4547
// Add a single slice to populate the Pyramid.
46-
pyramid.addSlice( 'Planning', 100 )
48+
pyramid.addSlice('Planning', 100)
4749

4850
// Add multiple slices to populate the Pyramid.
4951
pyramid.addSlices([
5052
{
51-
name: 'Slice1', value: 45
52-
}, {
53-
name: 'Slice2', value: 83
54-
}, {
55-
name: 'Slice3', value: 19
56-
}
57-
])
58-
53+
name: 'Slice1',
54+
value: 45,
55+
},
56+
{
57+
name: 'Slice2',
58+
value: 83,
59+
},
60+
{
61+
name: 'Slice3',
62+
value: 19,
63+
},
64+
])
5965
```
6066

6167
You can modify how the Pyramid and its slices are drawn through the Pyramid Chart's API.
6268

6369
```javascript
6470
// Set the width of the Pyramid's bottom edge. This value can be from 0 to 100 (in percents).
65-
pyramid.setNeckWidth( 80 )
71+
pyramid.setNeckWidth(80)
6672

6773
// Set the gap between each of the slices. This value can be between 0 to 20 pixels.
68-
pyramid.setSliceGap( 5 )
74+
pyramid.setSliceGap(5)
6975

7076
// If the labels are set to be placed on the side of the Pyramid,
7177
// we can determine the side here as well.
72-
pyramid.setLabelSide( PyramidLabelSide.Right )
73-
78+
pyramid.setLabelSide(PyramidLabelSide.Right)
7479
```
7580

7681
The Slices can be styled using the Pyramid Chart's API.
7782

7883
```javascript
7984
// Create a palette of Solid FillStyles to use with the Pyramid slices.
80-
const palette = SolidFillPalette( ColorPalettes.warm, data.length )
85+
const palette = SolidFillPalette(ColorPalettes.warm, data.length)
8186
// Set the palette used for coloring each of the slices.
82-
pyramid.setSliceFillStyle( palette )
83-
87+
pyramid.setSliceFillStyle(palette)
8488
```
8589

8690
The labels for all slices can be formatted in different ways.
8791

8892
```javascript
8993
// Set the label formatting to show the slice's name and the relative value
9094
// (size of the slice as percentage).
91-
pyramid.setLabelFormatter( SliceLabelFormatters.NamePlusRelativeValue )
95+
pyramid.setLabelFormatter(SliceLabelFormatters.NamePlusRelativeValue)
9296
```
9397

9498
The lines connecting each slice to its label can be modified.
@@ -98,10 +102,8 @@ The lines connecting each slice to its label can be modified.
98102
pyramid.setLabelConnectorStyle(
99103
new SolidLine({
100104
thickness: 3,
101-
fillStyle: new SolidFill(
102-
{ color: ColorRGBA( 100, 150, 195 ) }
103-
)
104-
})
105+
fillStyle: new SolidFill({ color: ColorRGBA(100, 150, 195) }),
106+
}),
105107
)
106108
```
107109

@@ -122,29 +124,29 @@ pyramid.setLabelConnectorStyle(
122124

123125
If you notice an error in the example code, please open an issue on [GitHub][0] repository of the entire example.
124126

125-
Official [API documentation][1] can be found on [Arction][2] website.
127+
Official [API documentation][1] can be found on [LightningChart][2] website.
126128

127129
If the docs and other materials do not solve your problem as well as implementation help is needed, ask on [StackOverflow][3] (tagged lightningchart).
128130

129-
If you think you found a bug in the LightningChart JavaScript library, please contact support@arction.com.
131+
If you think you found a bug in the LightningChart JavaScript library, please contact support@lightningchart.com.
130132

131-
Direct developer email support can be purchased through a [Support Plan][4] or by contacting sales@arction.com.
133+
Direct developer email support can be purchased through a [Support Plan][4] or by contacting sales@lightningchart.com.
132134

133135
[0]: https://github.com/Arction/
134-
[1]: https://www.arction.com/lightningchart-js-api-documentation/
135-
[2]: https://www.arction.com
136+
[1]: https://lightningchart.com/lightningchart-js-api-documentation/
137+
[2]: https://lightningchart.com
136138
[3]: https://stackoverflow.com/questions/tagged/lightningchart
137-
[4]: https://www.arction.com/support-services/
139+
[4]: https://lightningchart.com/support-services/
138140

139-
© Arction Ltd 2009-2020. All rights reserved.
141+
© LightningChart Ltd 2009-2022. All rights reserved.
140142

141143

142-
[Pyramid Chart]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/classes/pyramidchart.html
143-
[Pyramid Chart Types]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/globals.html#pyramidcharttypes
144-
[Pyramid Label Side]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/enums/pyramidlabelside.html
145-
[Slice label formatter]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/globals.html#slicelabelformatter
146-
[Palette]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/globals.html#colorpalettes
147-
[SolidFillPalette]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/globals.html#solidfillpalette
148-
[Solid Line]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/classes/solidline.html
149-
[Solid Fill]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/classes/solidfill.html
144+
[Pyramid Chart]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/classes/PyramidChart.html
145+
[Pyramid Chart Types]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/variables/PyramidChartTypes-1.html
146+
[Pyramid Label Side]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/enums/PyramidLabelSide.html
147+
[Slice label formatter]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/types/SliceLabelFormatter.html
148+
[Palette]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/variables/ColorPalettes.html
149+
[SolidFillPalette]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/functions/SolidFillPalette.html
150+
[Solid Line]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/classes/SolidLine.html
151+
[Solid Fill]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/classes/SolidFill.html
150152

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"build": "webpack --mode production",
55
"start": "webpack serve"
66
},
7-
"license": "Custom",
7+
"license": "MIT",
88
"private": true,
99
"main": "./src/index.js",
1010
"devDependencies": {
@@ -17,7 +17,7 @@
1717
"webpack-stream": "^7.0.0"
1818
},
1919
"dependencies": {
20-
"@arction/lcjs": "^3.4.0",
20+
"@arction/lcjs": "^4.0.1",
2121
"@arction/xydata": "^1.4.0"
2222
},
2323
"lightningChart": {

simplePyramid-cyberSpace.png

292 KB
Loading

simplePyramid-darkGold.png

149 KB
Loading

simplePyramid-light.png

63 KB
Loading

simplePyramid-lightNature.png

60 KB
Loading

simplePyramid-turquoiseHexagon.png

366 KB
Loading

src/index.js

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,15 @@
55
const lcjs = require('@arction/lcjs')
66

77
// Extract required parts from LightningChartJS.
8-
const {
9-
PyramidChartTypes,
10-
PyramidLabelSide,
11-
SliceLabelFormatters,
12-
lightningChart,
13-
LegendBoxBuilders,
14-
Themes
15-
} = lcjs
8+
const { PyramidChartTypes, PyramidLabelSide, SliceLabelFormatters, lightningChart, LegendBoxBuilders, Themes } = lcjs
169

1710
// Create a Pyramid chart
1811
const pyramid = lightningChart()
1912
.Pyramid({
20-
// theme: Themes.darkGold
21-
type: PyramidChartTypes.LabelsOnSides
13+
// theme: Themes.darkGold
14+
type: PyramidChartTypes.LabelsOnSides,
2215
})
2316
.setTitle('Company staff growth')
24-
.setAnimationsEnabled(true)
2517
.setNeckWidth(80)
2618
.setSliceGap(5)
2719
.setPadding({ bottom: 45 })
@@ -31,20 +23,20 @@ const pyramid = lightningChart()
3123
const data = [
3224
{
3325
name: '2015 - 2016',
34-
value: 3
26+
value: 3,
3527
},
3628
{
3729
name: '2016 - 2017',
38-
value: 5
30+
value: 5,
3931
},
4032
{
4133
name: '2017 - 2018',
42-
value: 10
34+
value: 10,
4335
},
4436
{
4537
name: '2018 - 2019',
46-
value: 17
47-
}
38+
value: 17,
39+
},
4840
]
4941
// Add data to the slices
5042
pyramid.addSlices(data)
@@ -58,8 +50,8 @@ const lb = pyramid
5850
// Dispose example UI elements automatically if they take too much space. This is to avoid bad UI on mobile / etc. devices.
5951
.setAutoDispose({
6052
type: 'max-width',
61-
maxWidth: 0.80,
53+
maxWidth: 0.8,
6254
})
6355

6456
// Add the Pyramid to the LegendBox and disable the button click functionality.
65-
lb.add(pyramid, { disposeOnClick: false })
57+
lb.add(pyramid, { toggleVisibilityOnClick: false })

0 commit comments

Comments
 (0)