Skip to content

Commit 107bbcd

Browse files
committed
LCJS 4.0.1
1 parent 9fec05c commit 107bbcd

11 files changed

+449
-496
lines changed

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

+16-16
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

+21
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

+36-36
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# JavaScript Heatmap Spectrogram Chart
22

3-
![JavaScript Heatmap Spectrogram Chart](spectrogram.png)
3+
![JavaScript Heatmap Spectrogram Chart](spectrogram-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
@@ -36,26 +36,26 @@ const response = await fetch('url')
3636
const buffer = await response.arrayBuffer()
3737
```
3838

39-
This example uses the [Web Audio APIs][web-audio-api] to retrieve the frequency data to display in the heatmap. These APIs make it easy to work with audio files and manipulate the files. For spectrogram use the [AnalyzerNode][analyzer-node] is the most useful part of the API as it provides [getByteFrequencyData][getByteFrequencyData] method which is a implementation of [Fast Fourier Transform][fft].
40-
The AudioContext contains method to convert an ArrayBuffer into an [AudioBuffer][AudioBuffer].
39+
This example uses the [Web Audio APIs][web-audio-api] to retrieve the frequency data to display in the heatmap. These APIs make it easy to work with audio files and manipulate the files. For spectrogram use the [AnalyzerNode][analyzer-node] is the most useful part of the API as it provides [getByteFrequencyData][getbytefrequencydata] method which is a implementation of [Fast Fourier Transform][fft].
40+
The AudioContext contains method to convert an ArrayBuffer into an [AudioBuffer][audiobuffer].
4141

4242
```js
4343
const audioBuffer = await audioContext.decodeAudioData(buffer)
4444
```
4545

4646
Now that the audio file is converted into a AudioBuffer it's possible to start extracting data from it.
4747

48-
To process the full audio buffer as fast as possible, a [OfflineAudioContext][OfflineAudioContext] is used. The OfflineAudioContext doesn't output the data to a audio device, instead it will go through the audio as fast as possible and outputs an AudioBuffer with the processed data. In this example the processed audio buffer is not used, but the processing is used to calculate the FFT data we need to display the intensities for each frequency in the spectrogram. The audio buffer we have created is used as a [buffer source][createBufferSource] for the OfflineAudioContext.
48+
To process the full audio buffer as fast as possible, a [OfflineAudioContext][offlineaudiocontext] is used. The OfflineAudioContext doesn't output the data to a audio device, instead it will go through the audio as fast as possible and outputs an AudioBuffer with the processed data. In this example the processed audio buffer is not used, but the processing is used to calculate the FFT data we need to display the intensities for each frequency in the spectrogram. The audio buffer we have created is used as a [buffer source][createbuffersource] for the OfflineAudioContext.
4949

50-
The buffer source only has a single output but we want to be able to process each channel separately, to do this a [ChannelSplitter][createChannelSplitter] is used with the output count matching the source channel count.
50+
The buffer source only has a single output but we want to be able to process each channel separately, to do this a [ChannelSplitter][createchannelsplitter] is used with the output count matching the source channel count.
5151

5252
```js
5353
const splitter = offlineCtx.createChannelSplitter(source.channelCount)
5454
```
5555

5656
This makes it possible to process each channel separately by making it possible to create AnalyzerNodes for each channel and only piping a single channel to each analyzer.
5757

58-
A [ScriptProcessorNode][createScriptProcessor] is used to go through the audio buffer in chuncks. For each chunk, the FFT data is calculated for each channel and stored in large enough buffers to fit the full data.
58+
A [ScriptProcessorNode][createscriptprocessor] is used to go through the audio buffer in chuncks. For each chunk, the FFT data is calculated for each channel and stored in large enough buffers to fit the full data.
5959

6060
Last [startRendering()][start-rendering] method is called to render out the audio buffer. This is when all of the FFT calculation is done.
6161

@@ -67,22 +67,22 @@ The data from the audio APIs is in wrong format to display in the heatmap withou
6767

6868
```js
6969
// Datamapping for vertical spectrogram
70-
const output = Array.from(Array(tickCount)).map(()=> Array.from(Array(strideSize)))
71-
for(let row = 0; row < strideSize; row += 1){
72-
output[row] = arr.slice(row*strideSize, row*strideSize + strideSize)
70+
const output = Array.from(Array(tickCount)).map(() => Array.from(Array(strideSize)))
71+
for (let row = 0; row < strideSize; row += 1) {
72+
output[row] = arr.slice(row * strideSize, row * strideSize + strideSize)
7373
}
7474
```
7575

7676
[web-audio-api]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API
7777
[analyzer-node]: https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode
78-
[getByteFrequencyData]: https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteFrequencyData
78+
[getbytefrequencydata]: https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteFrequencyData
7979
[fft]: https://en.wikipedia.org/wiki/Fast_Fourier_transform
8080
[fetch]: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch
81-
[AudioBuffer]: https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer
82-
[OfflineAudioContext]: https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext
83-
[createBufferSource]: https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createBufferSource
84-
[createChannelSplitter]: https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createChannelSplitter
85-
[createSciptProcessor]: https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createScriptProcessor
81+
[audiobuffer]: https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer
82+
[offlineaudiocontext]: https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext
83+
[createbuffersource]: https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createBufferSource
84+
[createchannelsplitter]: https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createChannelSplitter
85+
[createsciptprocessor]: https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createScriptProcessor
8686
[start-rendering]: https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext/startRendering
8787

8888

@@ -103,30 +103,30 @@ for(let row = 0; row < strideSize; row += 1){
103103

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

106-
Official [API documentation][1] can be found on [Arction][2] website.
106+
Official [API documentation][1] can be found on [LightningChart][2] website.
107107

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

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

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

114114
[0]: https://github.com/Arction/
115-
[1]: https://www.arction.com/lightningchart-js-api-documentation/
116-
[2]: https://www.arction.com
115+
[1]: https://lightningchart.com/lightningchart-js-api-documentation/
116+
[2]: https://lightningchart.com
117117
[3]: https://stackoverflow.com/questions/tagged/lightningchart
118-
[4]: https://www.arction.com/support-services/
118+
[4]: https://lightningchart.com/support-services/
119119

120-
© Arction Ltd 2009-2020. All rights reserved.
120+
© LightningChart Ltd 2009-2022. All rights reserved.
121121

122122

123-
[Heatmap Grid Series Intensity]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/classes/heatmapgridseriesintensityvalues.html
124-
[Paletted Fill Style]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/classes/palettedfill.html
125-
[LUT]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/classes/lut.html
126-
[Dashboard]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/classes/dashboard.html
127-
[Automatic axis scrolling options]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/globals.html#axisscrollstrategies
128-
[Automatic axis tick placement options]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/globals.html#axistickstrategies
129-
[Color factory HSV]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/globals.html#colorhsv
130-
[Empty fill style]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/globals.html#emptyfill
131-
[Empty line style]: https://www.arction.com/lightningchart-js-api-documentation/v3.4.0/globals.html#emptyline
123+
[Heatmap Grid Series Intensity]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/classes/HeatmapGridSeriesIntensityValues.html
124+
[Paletted Fill Style]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/classes/PalettedFill.html
125+
[LUT]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/classes/LUT.html
126+
[Dashboard]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/classes/Dashboard.html
127+
[Automatic axis scrolling options]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/variables/AxisScrollStrategies.html
128+
[Automatic axis tick placement options]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/variables/AxisTickStrategies.html
129+
[Color factory HSV]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/functions/ColorHSV.html
130+
[Empty fill style]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/variables/emptyFill-1.html
131+
[Empty line style]: https://lightningchart.com/lightningchart-js-api-documentation/v4.0.0/variables/emptyLine.html
132132

package.json

+2-2
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": {

spectrogram-cyberSpace.png

920 KB
Loading

spectrogram-darkGold.png

875 KB
Loading

spectrogram-light.png

1 MB
Loading

spectrogram-lightNature.png

979 KB
Loading

spectrogram-turquoiseHexagon.png

993 KB
Loading

0 commit comments

Comments
 (0)