mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel
This commit is contained in:
commit
a8bbf3d6b0
|
@ -29,12 +29,12 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* flags example format:
|
* config example format:
|
||||||
* {
|
* {
|
||||||
* shape: {
|
* shape: {
|
||||||
* type: EdgeShaper.shapes.ARROW
|
* type: EdgeShaper.shapes.ARROW
|
||||||
* }
|
* }
|
||||||
* label: "key" \\ function(node)
|
* label: "key" \\ function(edge)
|
||||||
* actions: {
|
* actions: {
|
||||||
* click: function(edge)
|
* click: function(edge)
|
||||||
* }
|
* }
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function EdgeShaper(parent, flags, idfunc) {
|
function EdgeShaper(parent, config, idfunc) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var self = this,
|
var self = this,
|
||||||
|
@ -332,8 +332,8 @@ function EdgeShaper(parent, flags, idfunc) {
|
||||||
toplevelSVG = d3.select(toplevelSVG[0][0].ownerSVGElement);
|
toplevelSVG = d3.select(toplevelSVG[0][0].ownerSVGElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags === undefined) {
|
if (config === undefined) {
|
||||||
flags = {
|
config = {
|
||||||
color: {
|
color: {
|
||||||
type: "single",
|
type: "single",
|
||||||
stroke: "#686766"
|
stroke: "#686766"
|
||||||
|
@ -341,14 +341,14 @@ function EdgeShaper(parent, flags, idfunc) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags.color === undefined) {
|
if (config.color === undefined) {
|
||||||
flags.color = {
|
config.color = {
|
||||||
type: "single",
|
type: "single",
|
||||||
stroke: "#686766"
|
stroke: "#686766"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
parseConfig(flags);
|
parseConfig(config);
|
||||||
|
|
||||||
if (_.isFunction(idfunc)) {
|
if (_.isFunction(idfunc)) {
|
||||||
idFunction = idfunc;
|
idFunction = idfunc;
|
||||||
|
|
|
@ -113,6 +113,13 @@ gs = _.sortBy(gs, sortF);
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label for="nodeColor" class="control-label">Vertex color attribute (e.g. "name")</label>
|
||||||
|
<div class="controls">
|
||||||
|
<input id="nodeColor" type="text" name="nodeColor" placeholder="Attribute" maxlength="75" class="input-xlarge">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<fieldset id="group_by_list">
|
<fieldset id="group_by_list">
|
||||||
<legend class="gv_inner">Grouping of vertices:</legend>
|
<legend class="gv_inner">Grouping of vertices:</legend>
|
||||||
|
|
|
@ -55,6 +55,7 @@ window.graphView = Backbone.View.extend({
|
||||||
groupByList,
|
groupByList,
|
||||||
groupByAttribute,
|
groupByAttribute,
|
||||||
label,
|
label,
|
||||||
|
color,
|
||||||
config,
|
config,
|
||||||
ui,
|
ui,
|
||||||
width,
|
width,
|
||||||
|
@ -64,6 +65,7 @@ window.graphView = Backbone.View.extend({
|
||||||
ncol = $("#nodeCollection").val();
|
ncol = $("#nodeCollection").val();
|
||||||
undirected = !!$("#undirected").attr("checked");
|
undirected = !!$("#undirected").attr("checked");
|
||||||
label = $("#nodeLabel").val();
|
label = $("#nodeLabel").val();
|
||||||
|
color = $("#nodeColor").val();
|
||||||
randomStart = !!$("#randomStart").attr("checked");
|
randomStart = !!$("#randomStart").attr("checked");
|
||||||
|
|
||||||
groupByAttribute = [];
|
groupByAttribute = [];
|
||||||
|
@ -92,6 +94,13 @@ window.graphView = Backbone.View.extend({
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
if (color !== undefined && color !== "") {
|
||||||
|
config.nodeShaper = config.nodeShaper || {};
|
||||||
|
config.nodeShaper.color = {
|
||||||
|
type: "attribute",
|
||||||
|
key: color
|
||||||
|
};
|
||||||
|
}
|
||||||
width = this.width || $("#content").width();
|
width = this.width || $("#content").width();
|
||||||
$("#background").remove();
|
$("#background").remove();
|
||||||
if (randomStart) {
|
if (randomStart) {
|
||||||
|
|
Loading…
Reference in New Issue