Skip to content

Commit b1e6e89

Browse files
committed
Metamodel - implemented groupable, colorable, sizable.
1 parent 34391f4 commit b1e6e89

7 files changed

Lines changed: 29 additions & 15 deletions

File tree

dist/css/evolutility.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ label {
209209
float: left;
210210
}
211211
.evo-color-box {
212+
display: inline-block;
212213
height: 20px;
213214
width: 20px;
214215
border: solid 1px silver;

dist/css/evolutility.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/evolutility.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,18 +2089,20 @@ Evol.ViewMany.Bubbles = Evol.ViewMany.extend({
20892089
h+='<label>'+Evol.i18n.vizGroupBy+'</label>'+
20902090
'<div class="btn-group" data-toggle="buttons">'+
20912091
_.map(fs2, function(f, idx){
2092-
return '<label class="btn btn-default'+(idx===0?' active':'')+'" id="'+f.id+'">'+
2093-
'<input type="radio" name="options"'+(idx===0?' checked':'')+'> '+f.label+'</label>';
2094-
}).join('')+
2092+
if(_.isUndefined(f.groupable) || f.groupable){
2093+
return '<label class="btn btn-default'+(idx===0?' active':'')+'" id="'+f.id+'">'+
2094+
'<input type="radio" name="options"'+(idx===0?' checked':'')+'>'+f.label+'</label>';
2095+
}
2096+
}).join('')+
20952097
'</div>';
20962098
// --- Color ---
20972099
var fo=_.map(fs2, function(f, idx){
2098-
return hOpt(f.id, f.label, idx===0);
2100+
return (_.isUndefined(f.colorable) || f.colorable) ? hOpt(f.id, f.label, idx===0) : '';
20992101
});
21002102
h+='<label>'+Evol.i18n.vizColorBy+'</label><select class="form-control bubble-color">'+hOptNull + fo.join('')+'</select>';
21012103
// --- Size ---
21022104
fs2=_.filter(fs2, function(f){
2103-
return Evol.Dico.isNumberType(f.type);
2105+
return (_.isUndefined(f.sizable) || f.sizable) ? Evol.Dico.isNumberType(f.type) : '';
21042106
});
21052107
fo=_.map(fs2, function(f, idx){
21062108
return hOpt(f.id, f.label);
@@ -4926,7 +4928,7 @@ return Backbone.View.extend({
49264928
addOK=false;
49274929
}
49284930
editor.append(h);
4929-
if(fType==fts.date){// TODO add datepicker widget to build and uncomment this
4931+
if(fType==fts.date){
49304932
editor.find('#value,#value2').datepicker({dateFormat:this.dateFormat});
49314933
}
49324934
}

dist/evolutility.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/ui-model.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,12 @@ <h1>field</h1>
435435
<td>Column can be sorted by the field value (in "List" view).
436436
</td>
437437
</tr>
438+
<tr>
439+
<td>groupable, colorable, sizable
440+
</td>
441+
<td>Field can be used for grouping/coloring/sizing bubbles (in "Bubble" view).
442+
</td>
443+
</tr>
438444
<tr>
439445
<td>tooltip<span class="evol-asterix">*</span>
440446
</td>

js/many-bubbles.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,20 @@ Evol.ViewMany.Bubbles = Evol.ViewMany.extend({
7777
h+='<label>'+Evol.i18n.vizGroupBy+'</label>'+
7878
'<div class="btn-group" data-toggle="buttons">'+
7979
_.map(fs2, function(f, idx){
80-
return '<label class="btn btn-default'+(idx===0?' active':'')+'" id="'+f.id+'">'+
81-
'<input type="radio" name="options"'+(idx===0?' checked':'')+'> '+f.label+'</label>';
82-
}).join('')+
80+
if(_.isUndefined(f.groupable) || f.groupable){
81+
return '<label class="btn btn-default'+(idx===0?' active':'')+'" id="'+f.id+'">'+
82+
'<input type="radio" name="options"'+(idx===0?' checked':'')+'>'+f.label+'</label>';
83+
}
84+
}).join('')+
8385
'</div>';
8486
// --- Color ---
8587
var fo=_.map(fs2, function(f, idx){
86-
return hOpt(f.id, f.label, idx===0);
88+
return (_.isUndefined(f.colorable) || f.colorable) ? hOpt(f.id, f.label, idx===0) : '';
8789
});
8890
h+='<label>'+Evol.i18n.vizColorBy+'</label><select class="form-control bubble-color">'+hOptNull + fo.join('')+'</select>';
8991
// --- Size ---
9092
fs2=_.filter(fs2, function(f){
91-
return Evol.Dico.isNumberType(f.type);
93+
return (_.isUndefined(f.sizable) || f.sizable) ? Evol.Dico.isNumberType(f.type) : '';
9294
});
9395
fo=_.map(fs2, function(f, idx){
9496
return hOpt(f.id, f.label);

0 commit comments

Comments
 (0)