Commit 5aa126a6 authored by Yannick Chudy's avatar Yannick Chudy

btn layout

parent 2735b2c9
...@@ -25,6 +25,11 @@ ...@@ -25,6 +25,11 @@
height:0px; height:0px;
padding-right: 4px; padding-right: 4px;
} }
#btn_2d3d { padding: 7px; }
#btn_2d3d span.small { font-size: x-small}
#btn_2d3d span.active { font-weight: bold }
</style> </style>
<template> <template>
...@@ -46,7 +51,9 @@ ...@@ -46,7 +51,9 @@
<div class="ui divider"></div> <div class="ui divider"></div>
<a class="item" id="btn_rotate"><i class="play icon"></i></a> <a class="item" id="btn_rotate"><i class="play icon"></i></a>
<a class="item" id="btn_2d3d"><i class="cubes icon"></i><span>2D<span></a> <a class="item" id="btn_2d3d"><i class="cubes icon"></i>
<span class="active">2D</span><span>/</span><span class='small'>3D</span>
</a>
<div class="ui divider"></div> <div class="ui divider"></div>
...@@ -167,10 +174,11 @@ ...@@ -167,10 +174,11 @@
}); });
$('#btn_2d3d').click(()=> { $('#btn_2d3d').click(()=> {
var t = $('#btn_2d3d').text(); var t = $('#btn_2d3d span.active').text();
t = t == "2D" ? "3D" : "2D" t = t == "2D" ? "3D" : "2D";
this.app.trigger('engine:layout', t + '_Force_directed') this.app.trigger('engine:layout', t + '_Force_directed')
$('#btn_2d3d span').text(t) $('#btn_2d3d span').toggleClass('active')
$('#btn_2d3d span').toggleClass('small')
}); });
}, },
attached() { attached() {
...@@ -302,7 +310,7 @@ ...@@ -302,7 +310,7 @@
}); });
}); });
app.listenTo(app.models.graph, 'reset', function(response, args, state) { app.listenTo(app.models.graph, 'reset', function() {
$("padagraph-collection-filter").each( function(i,e) { $("padagraph-collection-filter").each( function(i,e) {
if ( e.graph && e.reset_filters ) e.reset_filters(); if ( e.graph && e.reset_filters ) e.reset_filters();
}); });
......
This diff is collapsed.
This diff is collapsed.
...@@ -1090,7 +1090,7 @@ gviz.ThreeViz = Backbone.View.extend({ ...@@ -1090,7 +1090,7 @@ gviz.ThreeViz = Backbone.View.extend({
controls.dynamicDampingFactor = 0.3; controls.dynamicDampingFactor = 0.3;
controls.minDistance = 50; controls.minDistance = 50;
//custom //custom
controls.autoRotateSpeed = 0.002; controls.autoRotateSpeed = 0.00045;
controls.AUTO_ROTATE = this.auto_rotate controls.AUTO_ROTATE = this.auto_rotate
// init renderer // init renderer
......
This diff is collapsed.
...@@ -2046,14 +2046,6 @@ require(['backbone', 'cello', 'gviz', 'materials', 'pdgconst'], function (Backbo ...@@ -2046,14 +2046,6 @@ require(['backbone', 'cello', 'gviz', 'materials', 'pdgconst'], function (Backbo
if (!app || graph == null || !graph.vs) return; if (!app || graph == null || !graph.vs) return;
if (this.gviz) return; if (this.gviz) return;
_.each($("padagraph-engine-control", this), function (el, i, l) {
if (el) {
var engine = app.engines[el.engine];
el.app = app;
if (engine.blocks.models.length) el.block = engine.blocks.models[0];
}
});
var filters = $("padagraph-collection-filter", this); var filters = $("padagraph-collection-filter", this);
if (filters.length) { if (filters.length) {
_(filters).forEach(function (f) { _(filters).forEach(function (f) {
...@@ -2062,11 +2054,19 @@ require(['backbone', 'cello', 'gviz', 'materials', 'pdgconst'], function (Backbo ...@@ -2062,11 +2054,19 @@ require(['backbone', 'cello', 'gviz', 'materials', 'pdgconst'], function (Backbo
}); });
} }
//graph.on('reset', ()=>{ graph.on('reset', function () {
//_(filters).forEach((f) => { _(filters).forEach(function (f) {
//f.reset_filters() f.reset_filters();
//}); });
//}); });
_.each($("padagraph-engine-control"), function (el, i, l) {
if (el) {
var engine = app.engines[el.engine];
el.app = app;
if (engine.blocks.models.length) el.block = engine.blocks.models[0];
}
});
var search = $("padagraph-node-search"); var search = $("padagraph-node-search");
if (search.length) { if (search.length) {
...@@ -2114,12 +2114,10 @@ require(['backbone', 'cello', 'gviz', 'materials', 'pdgconst'], function (Backbo ...@@ -2114,12 +2114,10 @@ require(['backbone', 'cello', 'gviz', 'materials', 'pdgconst'], function (Backbo
app.set_viz(gviz); app.set_viz(gviz);
var ctrl = $("padagraph-gviz-control"); _.each($("padagraph-gviz-control"), function (ctrl, i, l) {
if (ctrl.length) {
ctrl = ctrl[0];
ctrl.app = app; ctrl.app = app;
ctrl.gviz = gviz; ctrl.gviz = gviz;
} });
this.gviz = gviz; this.gviz = gviz;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment