Skip to content

Commit b14a4e3

Browse files
committed
Merge branch 'dev'
2 parents 28299f8 + fffe762 commit b14a4e3

File tree

4 files changed

+148
-17
lines changed

4 files changed

+148
-17
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ deploy:
4343
api_key: $GITHUB_TOKEN
4444
skip_cleanup: true
4545
overwrite: true
46+
file : package-lock.json
4647
on:
4748
branch: master
4849
condition: $TRAVIS_COMMIT_MESSAGE == *"[run deploy]"*

lib/viewer/chartConfig.js

Lines changed: 102 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,20 @@ WOQLChartConfig.prototype.xAxis = function(...vars){
146146
return woqlRule;
147147
}
148148

149+
WOQLChartConfig.prototype.legend = function(...vars){
150+
let woqlRule = new WOQLChartRule().scope("Legend");
151+
woqlRule.setVariables(vars);
152+
this.rules.push(woqlRule);
153+
return woqlRule;
154+
}
155+
156+
WOQLChartConfig.prototype.yAxis = function(...vars){
157+
let woqlRule = new WOQLChartRule().scope("YAxis");
158+
woqlRule.setVariables(vars);
159+
this.rules.push(woqlRule);
160+
return woqlRule;
161+
}
162+
149163
WOQLChartConfig.prototype.bar = function(...vars){
150164
let woqlRule=new WOQLChartRule().scope("Bar");
151165
woqlRule.setVariables(vars);
@@ -174,6 +188,7 @@ WOQLChartConfig.prototype.area=function(...vars){
174188
return woqlRule;
175189
}
176190

191+
//fillOpacity
177192
/**
178193
*
179194
* @param {Chart} scope
@@ -215,6 +230,17 @@ WOQLChartRule.prototype.legendType = function(legendType){
215230
}
216231

217232

233+
WOQLChartRule.prototype.fillOpacity = function(fillOpacity){
234+
if(fillOpacity || fillOpacity===0){
235+
this.rule.fillOpacity = fillOpacity;
236+
return this;
237+
}
238+
return this.rule.fillOpacity;
239+
}
240+
241+
242+
243+
218244
WOQLChartRule.prototype.fill=function(color){
219245
if(color){
220246
this.rule.fill = color;
@@ -268,10 +294,47 @@ WOQLChartRule.prototype.padding=function(paddingObj){
268294
}
269295

270296
/*
271-
* The type of xAxis or yAxis 'number' | 'category' default is 'category'.
297+
*
298+
*/
299+
300+
WOQLChartRule.prototype.labelDateInput=function(labelDateInput){
301+
if(labelDateInput){
302+
this.rule.labelDateInput=labelDateInput
303+
return this;
304+
}
305+
return this.rule.labelDateInput
306+
}
307+
308+
/*
309+
* output date example 'YYYY-MM-DD' : 2020:03:11 or ''YYYY [text] YYYY', 2020 mytext 2020'
310+
*/
311+
312+
WOQLChartRule.prototype.labelDateOutput=function(labelDateOutput){
313+
if(labelDateOutput){
314+
this.rule.labelDateOutput=labelDateOutput
315+
return this;
316+
}
317+
return this.rule.labelDateOutput
318+
}
319+
320+
WOQLChartRule.prototype.stackId=function(stackId){
321+
if(stackId){
322+
this.rule.stackId=stackId
323+
return this;
324+
}
325+
return this.rule.stackId
326+
}
327+
328+
329+
330+
/*
331+
* The type of xAxis 'number' | 'category' default is 'category'
332+
* The type of yAxis 'number' | 'category' default is 'number'
272333
* The type of line chart 'basis'|'basisClosed'|'basisOpen'|'linear'|'linearClosed'|'natural'|'monotoneX'|'monotoneY'|'monotone' | 'step' | 'stepBefore' | 'stepAfter' |
273334
*/
274335

336+
337+
275338
WOQLChartRule.prototype.type=function(type){
276339
if(type){
277340
this.rule.type=type
@@ -291,6 +354,44 @@ WOQLChartRule.prototype.axisDomain=function(domainArr){
291354
return this.rule.domain
292355
}
293356

357+
/*
358+
*
359+
* @param {string} name of the variable for the custom color
360+
*/
361+
362+
WOQLChartRule.prototype.colorEntry=function(propValue){
363+
if(propValue){
364+
this.rule.colorEntry=propValue
365+
return this;
366+
}
367+
return this.rule.colorEntry
368+
}
369+
370+
/*
371+
*
372+
* @param {object} an object of possible value and color {"value1":"#ff0000"...}
373+
*/
374+
375+
WOQLChartRule.prototype.customColors=function(colorsObj){
376+
if(colorsObj){
377+
this.rule.customColors=colorsObj
378+
return this;
379+
}
380+
return this.rule.customColors
381+
}
382+
383+
/*
384+
* @param {array} payload array of the object for descrive the legend [{value:"legend label",color:"#ff0000",type:"rect"}]
385+
*/
386+
387+
WOQLChartRule.prototype.payload=function(payloadArr){
388+
if(payloadArr){
389+
this.rule.payload=payloadArr
390+
return this;
391+
}
392+
return this.rule.payload
393+
}
394+
294395

295396
WOQLChartRule.prototype.barSize=function(barSize){
296397
if(barSize){

lib/woql.js

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ WOQL.when = function(Query, Update){ return new WOQLQuery().when(Query, Update);
2525
/**
2626
* The Query in the Optional argument is specified as optional
2727
* @param {object} query - WOQL Query object
28+
* @example
29+
* WOQL.opt(WOQL.triple("v:optionalSubject", "v:optionalObject", "v:optionalValue"))
2830
* @return {object} WOQLQuery
2931
*/
3032
WOQL.opt = function(query){ return new WOQLQuery().opt(query); }
@@ -69,21 +71,49 @@ WOQL.start = function(start, query){ return new WOQLQuery().start(start, query);
6971
WOQL.select = function(...list){ return new WOQLQuery().select(...list); }
7072

7173
/**
72-
* Creates a logical OR of the arguments
74+
* Filter the query so only those triples that match any of the subqueries are included
7375
* @param queries - WOQL Query objects
7476
* @return {object} WOQLQuery
77+
*
78+
*
79+
* @example
80+
* // find triples that are of type scm:Journey, and have
81+
* // a start_station v:Start, and that start_station is labeled
82+
* // v:Start_Label
83+
*
84+
* WOQL.and(
85+
* WOQL.triple("v:Journey", "type", "scm:Journey"),
86+
* WOQL.or(
87+
* WOQL.triple("v:Journey", "scm:start_station", "doc:Station31007"),
88+
* WOQL.triple("v:Journey", "scm:start_station", "doc:Station31114")),
89+
* WOQL.triple("v:Journey", "scm:start_station", "v:Start"),
90+
* WOQL.triple("v:Start", "label", "v:Start_Label"))
91+
*
92+
* @see WOQLQuery().woql_or for WOQL.py version of the same function
7593
*/
7694
WOQL.or = function(...queries){ return new WOQLQuery().or(...queries); }
7795

7896
/**
79-
* Creates a logical AND of the arguments
97+
* Filter the query so only those triples that match all of the subqueries are included
8098
* @param queries - WOQL Query objects
8199
* @return {object} WOQLQuery
100+
*
101+
* @example
102+
* // find triples that are of type scm:Journey, and have
103+
* // a start_station v:Start, and that start_station is labeled
104+
* // v:Start_Label
105+
*
106+
* WOQL.and(
107+
* WOQL.triple("v:Journey", "type", "scm:Journey"),
108+
* WOQL.triple("v:Journey", "start_station", "v:Start"),
109+
* WOQL.triple("v:Start", "label", "v:Start_Label"))
110+
*
111+
* @see WOQLQuery().woql_and for WOQL.py version of the same function
82112
*/
83113
WOQL.and = function(...queries){ return new WOQLQuery().and(...queries); }
84114

85115
/**
86-
* Creates a logical NOT of the arguments
116+
* Include only triples that do not match the single contained query
87117
* @param queries - WOQL Query objects
88118
* @return {object} WOQLQuery
89119
*/

package.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@
1313
"author": "[email protected]",
1414
"license": "Apache-2.0",
1515
"dependencies": {
16-
"axios": "^0.19.0",
16+
"axios": "^0.19.2",
1717
"documentation": "^12.1.4",
18-
"prettier": "^1.19.1",
19-
"update": "^0.7.4"
18+
"prettier": "^1.19.1"
2019
},
2120
"devDependencies": {
22-
"@babel/core": "^7.7.7",
23-
"@babel/preset-env": "^7.7.7",
24-
"@babel/register": "^7.7.7",
21+
"@babel/core": "^7.8.4",
22+
"@babel/preset-env": "^7.8.4",
23+
"@babel/register": "^7.8.3",
2524
"babel-eslint": "^10.0.3",
2625
"babel-loader": "^8.0.6",
2726
"chai": "^4.2.0",
@@ -30,20 +29,20 @@
3029
"cross-env": "^5.2.1",
3130
"eslint": "^5.16.0",
3231
"eslint-config-airbnb": "^17.1.1",
33-
"eslint-plugin-import": "^2.19.1",
32+
"eslint-plugin-import": "^2.20.1",
3433
"eslint-plugin-jsx-a11y": "^6.2.3",
35-
"eslint-plugin-react": "^7.17.0",
34+
"eslint-plugin-react": "^7.18.3",
3635
"html-loader": "^0.5.5",
3736
"html-webpack-plugin": "^3.2.0",
3837
"install": "^0.13.0",
3938
"mocha": "^6.2.2",
40-
"nyc": "^13.3.0",
39+
"nyc": "^15.0.0",
4140
"rimraf": "^2.7.1",
4241
"sinon": "^7.5.0",
43-
"uglify-js": "^3.7.3",
44-
"webpack": "^4.41.5",
45-
"webpack-cli": "^3.3.10",
46-
"webpack-dev-server": "^3.10.1"
42+
"uglify-js": "^3.8.0",
43+
"webpack": "^4.41.6",
44+
"webpack-cli": "^3.3.11",
45+
"webpack-dev-server": "^3.10.3"
4746
},
4847
"scripts": {
4948
"versionWIN": "echo %npm_package_version%",

0 commit comments

Comments
 (0)