mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-24 13:53:43 +00:00
bindRootId configuration option
This commit is contained in:
parent
0f42fa2930
commit
473e57e225
3 changed files with 28 additions and 26 deletions
|
|
@ -184,25 +184,25 @@ foreach({
|
||||||
function(type, data, width, height) {
|
function(type, data, width, height) {
|
||||||
data = data || {};
|
data = data || {};
|
||||||
var chart = {
|
var chart = {
|
||||||
cht:type,
|
'cht':type,
|
||||||
chco:angularFilterGoogleChartApi.collect(data, 'color'),
|
'chco':angularFilterGoogleChartApi['collect'](data, 'color'),
|
||||||
chtt:angularFilterGoogleChartApi.title(data),
|
'chtt':angularFilterGoogleChartApi['title'](data),
|
||||||
chdl:angularFilterGoogleChartApi.collect(data, 'label'),
|
'chdl':angularFilterGoogleChartApi['collect'](data, 'label'),
|
||||||
chd:angularFilterGoogleChartApi.values(data),
|
'chd':angularFilterGoogleChartApi['values'](data),
|
||||||
chf:'bg,s,FFFFFF00'
|
'chf':'bg,s,FFFFFF00'
|
||||||
};
|
};
|
||||||
if (_.isArray(data.xLabels)) {
|
if (_.isArray(data['xLabels'])) {
|
||||||
chart.chxt='x';
|
chart['chxt']='x';
|
||||||
chart.chxl='0:|' + data.xLabels.join('|');
|
chart['chxl']='0:|' + data.xLabels.join('|');
|
||||||
}
|
}
|
||||||
return angularFilterGoogleChartApi['encode'](chart, width, height);
|
return angularFilterGoogleChartApi['encode'](chart, width, height);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'values': function(data){
|
'values': function(data){
|
||||||
var seriesValues = [];
|
var seriesValues = [];
|
||||||
foreach(data.series||[], function(serie){
|
foreach(data['series']||[], function(serie){
|
||||||
var values = [];
|
var values = [];
|
||||||
foreach(serie.values||[], function(value){
|
foreach(serie['values']||[], function(value){
|
||||||
values.push(value);
|
values.push(value);
|
||||||
});
|
});
|
||||||
seriesValues.push(values.join(','));
|
seriesValues.push(values.join(','));
|
||||||
|
|
@ -213,7 +213,7 @@ foreach({
|
||||||
|
|
||||||
'title': function(data){
|
'title': function(data){
|
||||||
var titles = [];
|
var titles = [];
|
||||||
var title = data.title || [];
|
var title = data['title'] || [];
|
||||||
foreach(_.isArray(title)?title:[title], function(text){
|
foreach(_.isArray(title)?title:[title], function(text){
|
||||||
titles.push(encodeURIComponent(text));
|
titles.push(encodeURIComponent(text));
|
||||||
});
|
});
|
||||||
|
|
@ -223,7 +223,7 @@ foreach({
|
||||||
'collect': function(data, key){
|
'collect': function(data, key){
|
||||||
var outterValues = [];
|
var outterValues = [];
|
||||||
var count = 0;
|
var count = 0;
|
||||||
foreach(data.series||[], function(serie){
|
foreach(data['series']||[], function(serie){
|
||||||
var innerValues = [];
|
var innerValues = [];
|
||||||
var value = serie[key] || [];
|
var value = serie[key] || [];
|
||||||
foreach(_.isArray(value)?value:[value], function(color){
|
foreach(_.isArray(value)?value:[value], function(color){
|
||||||
|
|
@ -240,7 +240,7 @@ foreach({
|
||||||
height = height || width;
|
height = height || width;
|
||||||
var url = "http://chart.apis.google.com/chart?";
|
var url = "http://chart.apis.google.com/chart?";
|
||||||
var urlParam = [];
|
var urlParam = [];
|
||||||
params.chs = width + "x" + height;
|
params['chs'] = width + "x" + height;
|
||||||
foreach(params, function(value, key){
|
foreach(params, function(value, key){
|
||||||
if (value) {
|
if (value) {
|
||||||
urlParam.push(key + "=" + value);
|
urlParam.push(key + "=" + value);
|
||||||
|
|
@ -256,37 +256,38 @@ foreach({
|
||||||
|
|
||||||
|
|
||||||
'qrcode': function(value, width, height) {
|
'qrcode': function(value, width, height) {
|
||||||
return angularFilterGoogleChartApi['encode']({cht:'qr', chl:encodeURIComponent(value)}, width, height);
|
return angularFilterGoogleChartApi['encode']({
|
||||||
|
'cht':'qr', 'chl':encodeURIComponent(value)}, width, height);
|
||||||
},
|
},
|
||||||
'chart': {
|
'chart': {
|
||||||
pie:function(data, width, height) {
|
'pie':function(data, width, height) {
|
||||||
return angularFilterGoogleChartApi('p', data, width, height);
|
return angularFilterGoogleChartApi('p', data, width, height);
|
||||||
},
|
},
|
||||||
pie3d:function(data, width, height) {
|
'pie3d':function(data, width, height) {
|
||||||
return angularFilterGoogleChartApi('p3', data, width, height);
|
return angularFilterGoogleChartApi('p3', data, width, height);
|
||||||
},
|
},
|
||||||
pieConcentric:function(data, width, height) {
|
'pieConcentric':function(data, width, height) {
|
||||||
return angularFilterGoogleChartApi('pc', data, width, height);
|
return angularFilterGoogleChartApi('pc', data, width, height);
|
||||||
},
|
},
|
||||||
barHorizontalStacked:function(data, width, height) {
|
'barHorizontalStacked':function(data, width, height) {
|
||||||
return angularFilterGoogleChartApi('bhs', data, width, height);
|
return angularFilterGoogleChartApi('bhs', data, width, height);
|
||||||
},
|
},
|
||||||
barHorizontalGrouped:function(data, width, height) {
|
'barHorizontalGrouped':function(data, width, height) {
|
||||||
return angularFilterGoogleChartApi('bhg', data, width, height);
|
return angularFilterGoogleChartApi('bhg', data, width, height);
|
||||||
},
|
},
|
||||||
barVerticalStacked:function(data, width, height) {
|
'barVerticalStacked':function(data, width, height) {
|
||||||
return angularFilterGoogleChartApi('bvs', data, width, height);
|
return angularFilterGoogleChartApi('bvs', data, width, height);
|
||||||
},
|
},
|
||||||
barVerticalGrouped:function(data, width, height) {
|
'barVerticalGrouped':function(data, width, height) {
|
||||||
return angularFilterGoogleChartApi('bvg', data, width, height);
|
return angularFilterGoogleChartApi('bvg', data, width, height);
|
||||||
},
|
},
|
||||||
line:function(data, width, height) {
|
'line':function(data, width, height) {
|
||||||
return angularFilterGoogleChartApi('lc', data, width, height);
|
return angularFilterGoogleChartApi('lc', data, width, height);
|
||||||
},
|
},
|
||||||
sparkline:function(data, width, height) {
|
'sparkline':function(data, width, height) {
|
||||||
return angularFilterGoogleChartApi('ls', data, width, height);
|
return angularFilterGoogleChartApi('ls', data, width, height);
|
||||||
},
|
},
|
||||||
scatter:function(data, width, height) {
|
'scatter':function(data, width, height) {
|
||||||
return angularFilterGoogleChartApi('s', data, width, height);
|
return angularFilterGoogleChartApi('s', data, width, height);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -695,7 +695,7 @@ Parser.prototype = {
|
||||||
self.scope.set(entity, Entity);
|
self.scope.set(entity, Entity);
|
||||||
if (instance) {
|
if (instance) {
|
||||||
var document = Entity();
|
var document = Entity();
|
||||||
document.$$anchor = instance;
|
document['$$anchor'] = instance;
|
||||||
self.scope.set(instance, document);
|
self.scope.set(instance, document);
|
||||||
return "$anchor." + instance + ":{" +
|
return "$anchor." + instance + ":{" +
|
||||||
instance + "=" + entity + ".load($anchor." + instance + ");" +
|
instance + "=" + entity + ".load($anchor." + instance + ");" +
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,7 @@ Scope.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
eval: function(expressionText, context) {
|
eval: function(expressionText, context) {
|
||||||
|
log('Scope.eval', expressionText);
|
||||||
var expression = Scope.expressionCache[expressionText];
|
var expression = Scope.expressionCache[expressionText];
|
||||||
if (!expression) {
|
if (!expression) {
|
||||||
var parser = new Parser(expressionText);
|
var parser = new Parser(expressionText);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue