Skip to content

Commit 6c492ba

Browse files
committed
Merge branch 'main' of github.com:vizzuhq/vizzu-lib into main
2 parents f599d08 + 3d74211 commit 6c492ba

File tree

8 files changed

+65
-625
lines changed

8 files changed

+65
-625
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ You can find information about how to work on the project in the following guide
1212

1313
Feel free to fork the project and send us a pull request. Any contribution you make is greatly appreciated.
1414

15+
If you have any question regarding Vizzu development, contact us at our Slack dev channel: https://vizzu-community.slack.com/messages/dev/
16+
1517
# Nightly builds
1618

1719
Vizzu uses a CI build environment. The builds are available on the following URLs.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
</p>
1111
</p>
1212

13+
[![install size](https://packagephobia.com/badge?p=vizzu)](https://packagephobia.com/result?p=vizzu)
14+
1315
# About The Project
1416

1517
Vizzu is a free, open-source Javascript/C++ library utilizing a generic dataviz engine

ci/cloudfunctions/getVizzuList/index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,22 @@ exports.getVizzuList = (req, res) => {
77
const bucket = storage.bucket(bucketName);
88
bucket.getFiles().then(files => {
99
let ans = [];
10+
files[0].sort((a, b) => {
11+
if (a.metadata.updated > b.metadata.updated) {
12+
return 1;
13+
}
14+
if (a.metadata.updated < b.metadata.updated) {
15+
return -1;
16+
}
17+
return 0;
18+
});
1019
files[0].forEach(file => {
1120
let fileEnd = '/vizzu.js'
1221
if (file.name.endsWith(fileEnd)) {
13-
ans.push(file.name.slice(0,-fileEnd.length));
22+
let tmp = {};
23+
tmp.sha = file.name.slice(0,-fileEnd.length)
24+
tmp.time = file.metadata.updated;
25+
ans.push(tmp);
1426
}
1527
});
1628
let message = req.query.message || req.body.message || JSON.stringify(ans);

ci/cloudfunctions/getVizzuList/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "getVizzuList",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"dependencies": {
55
"@google-cloud/storage": "*",
66
"@google-cloud/functions-framework": "*"

test/integration/manual/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import ImgDiff from './imgdiff.js';
33
let queryString = window.location.search;
44
let urlParams = new URLSearchParams(queryString);
55
let urlTestCase = urlParams.get('testCase');
6+
let urlVersion = urlParams.get('version');
67

78
let vizzuUrl = document.getElementById('vizzuUrl');
89
let vizzuRefUrl = 'https://vizzu-lib-main.storage.googleapis.com/lib';
@@ -72,8 +73,11 @@ function populateLibs()
7273
let url = data[name];
7374
vizzuUrl.innerHTML += `<option value='${url}'>${name}</option>`;
7475
}
75-
let lastSelected = localStorage.getItem('vizzuUrl');
76-
if (lastSelected === '') lastSelected = data['localhost'];
76+
let lastSelected = localStorage.getItem('vizzuUrl');
77+
if (urlVersion) {
78+
lastSelected = data[urlVersion];
79+
}
80+
if (lastSelected === '') lastSelected = data['localhost'];
7781
vizzuUrl.value = lastSelected;
7882
populateCases();
7983
});

test/integration/manual/manual.js

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,45 @@ class Manual {
2626

2727
this.#server.use(express.static(this.#rootPath));
2828

29-
this.#getLibList()
30-
this.#getTestList()
29+
this.#getLibList();
30+
this.#getTestList();
3131

3232
this.#server.listen(this.#port);
3333
console.log('[ HOSTING ]' + ' ' + '[ ' + 'http://127.0.0.1:' + this.#port + '/test/integration/manual' + ' ]' + ' press CTRL + C to stop');
3434
}
3535

36-
async #getLibList() {
37-
let libList = { localhost: 'http://127.0.0.1:' + this.#port + '/example/lib' };
38-
libList['HEAD'] = 'https://' + remoteStableBucket + '/lib';
39-
let vizzuListUrl = await fetch('https://' + remoteCloudFunctions + '/getVizzuList');
40-
let vizzuList = await vizzuListUrl.json();
41-
vizzuList.forEach(vizzu => {
42-
libList[vizzu] = 'https://' + remoteLatestBucket + '/' + vizzu;
43-
});
44-
libList['0.2.0'] = 'https://vizzuhq.github.io/vizzu-beta-release/0.2.0';
36+
#getLibList() {
4537
this.#server.get('/getLibList', (req, res) => {
46-
res.send(libList);
38+
let libList = { localhost: 'http://127.0.0.1:' + this.#port + '/example/lib' };
39+
libList['HEAD'] = 'https://' + remoteStableBucket + '/lib';
40+
this.#getLibJson().then(vizzuList => {
41+
vizzuList.slice().reverse().forEach(vizzu => {
42+
libList[vizzu.time.substring(0,10) + ' ' + vizzu.time.substring(11,16) + ' ' + vizzu.sha] = 'https://' + remoteLatestBucket + '/' + vizzu.sha;
43+
});
44+
//libList['0.3.1'] = 'https://cdn.jsdelivr.net/npm/[email protected]/dist';
45+
//libList['0.3.0'] = 'https://cdn.jsdelivr.net/npm/[email protected]/dist';
46+
libList['0.2.0'] = 'https://vizzuhq.github.io/vizzu-beta-release/0.2.0';
47+
res.send(libList);
48+
});
49+
});
50+
}
51+
52+
#getLibJson() {
53+
return new Promise(resolve => {
54+
fetch('https://' + remoteCloudFunctions + '/getVizzuList').then(vizzuListUrl => {
55+
vizzuListUrl.json().then(vizzuList => {
56+
resolve(vizzuList);
57+
}).catch((err) => {
58+
resolve(this.#getLibJson())
59+
});
60+
});
4761
});
4862
}
4963

5064
#getTestList() {
51-
this.#setTestList(this.#testPath);
5265
this.#server.get('/getTestList', (req, res) => {
66+
this.#testList = [];
67+
this.#setTestList(this.#testPath);
5368
res.send(this.#testList);
5469
});
5570
}

0 commit comments

Comments
 (0)