mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-02-15 18:21:28 +00:00
Fix save work area.
Fix export graph with styles. Fix css packer.
This commit is contained in:
@@ -94,5 +94,5 @@
|
||||
$g_config['vote'] = "./tmp/vote/vote.txt";
|
||||
$g_config['voteTopics'] = "./tmp/vote/voteTopics.txt_";
|
||||
$g_config['use_js_cache'] = true;
|
||||
$g_config['engine_version'] = 105;
|
||||
$g_config['engine_version'] = 106;
|
||||
?>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
public static function ChangeCssUrl_Url($url)
|
||||
{
|
||||
$url = self::ChangeCssUrl($url);
|
||||
return "url('$url')";
|
||||
return "url(\"$url\")";
|
||||
}
|
||||
|
||||
public static function ChangeCssUrl_Src($url)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
moduleLoader.beginCacheLoading(["/script/entities/graph/api/index.js?v=105","/script/shared/point.js?v=105","/script/entities/edge/api/index.js?v=105","/script/entities/edge/model/BaseEdge.js?v=105","/script/entities/edge/model/EdgeModel.js?v=105","/script/entities/vertex/api/index.js?v=105","/script/entities/vertex/model/BaseVertex.js?v=105","/script/entities/vertex/model/VertexModel.js?v=105","/script/entities/graph/model/Graph.js?v=105",]);{let modulDir="pages/create_graph_by_edge_list/";doInclude([include("entities/graph/api/index.js")]);}
|
||||
moduleLoader.beginCacheLoading(["/script/entities/graph/api/index.js?v=106","/script/shared/point.js?v=106","/script/entities/edge/api/index.js?v=106","/script/entities/edge/model/BaseEdge.js?v=106","/script/entities/edge/model/EdgeModel.js?v=106","/script/entities/vertex/api/index.js?v=106","/script/entities/vertex/model/BaseVertex.js?v=106","/script/entities/vertex/model/VertexModel.js?v=106","/script/entities/graph/model/Graph.js?v=106",]);{let modulDir="pages/create_graph_by_edge_list/";doInclude([include("entities/graph/api/index.js")]);}
|
||||
{let modulDir="entities/graph/";doInclude([include("shared/point.js"),include("entities/edge/api/index.js"),include("entities/vertex/api/index.js"),include("model/Graph.js",modulDir)])}function Point(x,y){this.x=x||0;this.y=y||0;};Point.prototype.x=null;Point.prototype.y=null;Point.prototype.add=function(v){return new Point(this.x+v.x,this.y+v.y);};Point.prototype.addValue=function(v){return new Point(this.x+v,this.y+v);};Point.prototype.clone=function(){return new Point(this.x,this.y);};Point.prototype.degreesTo=function(v){var dx=this.x-v.x;var dy=this.y-v.y;var angle=Math.atan2(dy,dx);return angle*(180/Math.PI);};Point.prototype.distance=function(v){return Math.sqrt(this.distanceSqr(v));};Point.prototype.distanceSqr=function(v){var x=this.x-v.x;var y=this.y-v.y;return x*x+y*y;};Point.prototype.equals=function(toCompare){return this.x==toCompare.x&&this.y==toCompare.y;};Point.prototype.interpolate=function(v,f){return new Point((this.x+v.x)*f,(this.y+v.y)*f);};Point.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y);};Point.prototype.normalize=function(thickness){var l=this.length();this.x=this.x/l*thickness;this.y=this.y/l*thickness;return new Point(this.x,this.y);};Point.prototype.normalizeCopy=function(thickness){var l=this.length();return new Point(this.x/l*thickness,this.y/l*thickness);};Point.prototype.orbit=function(origin,arcWidth,arcHeight,degrees){var radians=degrees*(Math.PI/180);this.x=origin.x+arcWidth*Math.cos(radians);this.y=origin.y+arcHeight*Math.sin(radians);};Point.prototype.rotate=function(center,degrees){var radians=degrees*(Math.PI/180);offset=this.subtract(center);this.x=offset.x*Math.cos(radians)-offset.y*Math.sin(radians);this.y=offset.x*Math.sin(radians)+offset.y*Math.cos(radians);this.x=this.x+center.x;this.y=this.y+center.y;return this;};Point.prototype.offset=function(dx,dy){this.x+=dx;this.y+=dy;};Point.prototype.subtract=function(v){return new Point(this.x-v.x,this.y-v.y);};Point.prototype.subtractValue=function(value){return new Point(this.x-value,this.y-value);};Point.prototype.multiply=function(value){return new Point(this.x*value,this.y*value);};Point.prototype.toString=function(){return"(x="+this.x+", y="+this.y+")";};Point.prototype.normal=function(){return new Point(-this.y,this.x);};Point.prototype.min=function(point)
|
||||
{return new Point(Math.min(this.x,point.x),Math.min(this.y,point.y));};Point.prototype.max=function(point)
|
||||
{return new Point(Math.max(this.x,point.x),Math.max(this.y,point.y));};Point.prototype.inverse=function()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
moduleLoader.beginCacheLoading(["/script/entities/graph/api/index.js?v=105","/script/shared/point.js?v=105","/script/entities/edge/api/index.js?v=105","/script/entities/edge/model/BaseEdge.js?v=105","/script/entities/edge/model/EdgeModel.js?v=105","/script/entities/vertex/api/index.js?v=105","/script/entities/vertex/model/BaseVertex.js?v=105","/script/entities/vertex/model/VertexModel.js?v=105","/script/entities/graph/model/Graph.js?v=105",]);{let modulDir="pages/create_graph_by_matrix/";doInclude([include("entities/graph/api/index.js")]);}
|
||||
moduleLoader.beginCacheLoading(["/script/entities/graph/api/index.js?v=106","/script/shared/point.js?v=106","/script/entities/edge/api/index.js?v=106","/script/entities/edge/model/BaseEdge.js?v=106","/script/entities/edge/model/EdgeModel.js?v=106","/script/entities/vertex/api/index.js?v=106","/script/entities/vertex/model/BaseVertex.js?v=106","/script/entities/vertex/model/VertexModel.js?v=106","/script/entities/graph/model/Graph.js?v=106",]);{let modulDir="pages/create_graph_by_matrix/";doInclude([include("entities/graph/api/index.js")]);}
|
||||
{let modulDir="entities/graph/";doInclude([include("shared/point.js"),include("entities/edge/api/index.js"),include("entities/vertex/api/index.js"),include("model/Graph.js",modulDir)])}function Point(x,y){this.x=x||0;this.y=y||0;};Point.prototype.x=null;Point.prototype.y=null;Point.prototype.add=function(v){return new Point(this.x+v.x,this.y+v.y);};Point.prototype.addValue=function(v){return new Point(this.x+v,this.y+v);};Point.prototype.clone=function(){return new Point(this.x,this.y);};Point.prototype.degreesTo=function(v){var dx=this.x-v.x;var dy=this.y-v.y;var angle=Math.atan2(dy,dx);return angle*(180/Math.PI);};Point.prototype.distance=function(v){return Math.sqrt(this.distanceSqr(v));};Point.prototype.distanceSqr=function(v){var x=this.x-v.x;var y=this.y-v.y;return x*x+y*y;};Point.prototype.equals=function(toCompare){return this.x==toCompare.x&&this.y==toCompare.y;};Point.prototype.interpolate=function(v,f){return new Point((this.x+v.x)*f,(this.y+v.y)*f);};Point.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y);};Point.prototype.normalize=function(thickness){var l=this.length();this.x=this.x/l*thickness;this.y=this.y/l*thickness;return new Point(this.x,this.y);};Point.prototype.normalizeCopy=function(thickness){var l=this.length();return new Point(this.x/l*thickness,this.y/l*thickness);};Point.prototype.orbit=function(origin,arcWidth,arcHeight,degrees){var radians=degrees*(Math.PI/180);this.x=origin.x+arcWidth*Math.cos(radians);this.y=origin.y+arcHeight*Math.sin(radians);};Point.prototype.rotate=function(center,degrees){var radians=degrees*(Math.PI/180);offset=this.subtract(center);this.x=offset.x*Math.cos(radians)-offset.y*Math.sin(radians);this.y=offset.x*Math.sin(radians)+offset.y*Math.cos(radians);this.x=this.x+center.x;this.y=this.y+center.y;return this;};Point.prototype.offset=function(dx,dy){this.x+=dx;this.y+=dy;};Point.prototype.subtract=function(v){return new Point(this.x-v.x,this.y-v.y);};Point.prototype.subtractValue=function(value){return new Point(this.x-value,this.y-value);};Point.prototype.multiply=function(value){return new Point(this.x*value,this.y*value);};Point.prototype.toString=function(){return"(x="+this.x+", y="+this.y+")";};Point.prototype.normal=function(){return new Point(-this.y,this.x);};Point.prototype.min=function(point)
|
||||
{return new Point(Math.min(this.x,point.x),Math.min(this.y,point.y));};Point.prototype.max=function(point)
|
||||
{return new Point(Math.max(this.x,point.x),Math.max(this.y,point.y));};Point.prototype.inverse=function()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
moduleLoader.beginCacheLoading(["/script/entities/graph/api/index.js?v=105","/script/shared/point.js?v=105","/script/entities/edge/api/index.js?v=105","/script/entities/edge/model/BaseEdge.js?v=105","/script/entities/edge/model/EdgeModel.js?v=105","/script/entities/vertex/api/index.js?v=105","/script/entities/vertex/model/BaseVertex.js?v=105","/script/entities/vertex/model/VertexModel.js?v=105","/script/entities/graph/model/Graph.js?v=105","/script/pages/create_graph_by_matrix/model/createByMatrixMain.js?v=105","/script/pages/create_graph_by_matrix/model/main.js?v=105",]);{let modulDir="pages/create_graph_by_matrix/";doInclude([include("entities/graph/api/index.js"),include("model/createByMatrixMain.js",modulDir),include("model/main.js",modulDir)]);}
|
||||
moduleLoader.beginCacheLoading(["/script/entities/graph/api/index.js?v=106","/script/shared/point.js?v=106","/script/entities/edge/api/index.js?v=106","/script/entities/edge/model/BaseEdge.js?v=106","/script/entities/edge/model/EdgeModel.js?v=106","/script/entities/vertex/api/index.js?v=106","/script/entities/vertex/model/BaseVertex.js?v=106","/script/entities/vertex/model/VertexModel.js?v=106","/script/entities/graph/model/Graph.js?v=106","/script/pages/create_graph_by_matrix/model/createByMatrixMain.js?v=106","/script/pages/create_graph_by_matrix/model/main.js?v=106",]);{let modulDir="pages/create_graph_by_matrix/";doInclude([include("entities/graph/api/index.js"),include("model/createByMatrixMain.js",modulDir),include("model/main.js",modulDir)]);}
|
||||
{let modulDir="entities/graph/";doInclude([include("shared/point.js"),include("entities/edge/api/index.js"),include("entities/vertex/api/index.js"),include("model/Graph.js",modulDir)])}function Point(x,y){this.x=x||0;this.y=y||0;};Point.prototype.x=null;Point.prototype.y=null;Point.prototype.add=function(v){return new Point(this.x+v.x,this.y+v.y);};Point.prototype.addValue=function(v){return new Point(this.x+v,this.y+v);};Point.prototype.clone=function(){return new Point(this.x,this.y);};Point.prototype.degreesTo=function(v){var dx=this.x-v.x;var dy=this.y-v.y;var angle=Math.atan2(dy,dx);return angle*(180/Math.PI);};Point.prototype.distance=function(v){return Math.sqrt(this.distanceSqr(v));};Point.prototype.distanceSqr=function(v){var x=this.x-v.x;var y=this.y-v.y;return x*x+y*y;};Point.prototype.equals=function(toCompare){return this.x==toCompare.x&&this.y==toCompare.y;};Point.prototype.interpolate=function(v,f){return new Point((this.x+v.x)*f,(this.y+v.y)*f);};Point.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y);};Point.prototype.normalize=function(thickness){var l=this.length();this.x=this.x/l*thickness;this.y=this.y/l*thickness;return new Point(this.x,this.y);};Point.prototype.normalizeCopy=function(thickness){var l=this.length();return new Point(this.x/l*thickness,this.y/l*thickness);};Point.prototype.orbit=function(origin,arcWidth,arcHeight,degrees){var radians=degrees*(Math.PI/180);this.x=origin.x+arcWidth*Math.cos(radians);this.y=origin.y+arcHeight*Math.sin(radians);};Point.prototype.rotate=function(center,degrees){var radians=degrees*(Math.PI/180);offset=this.subtract(center);this.x=offset.x*Math.cos(radians)-offset.y*Math.sin(radians);this.y=offset.x*Math.sin(radians)+offset.y*Math.cos(radians);this.x=this.x+center.x;this.y=this.y+center.y;return this;};Point.prototype.offset=function(dx,dy){this.x+=dx;this.y+=dy;};Point.prototype.subtract=function(v){return new Point(this.x-v.x,this.y-v.y);};Point.prototype.subtractValue=function(value){return new Point(this.x-value,this.y-value);};Point.prototype.multiply=function(value){return new Point(this.x*value,this.y*value);};Point.prototype.toString=function(){return"(x="+this.x+", y="+this.y+")";};Point.prototype.normal=function(){return new Point(-this.y,this.x);};Point.prototype.min=function(point)
|
||||
{return new Point(Math.min(this.x,point.x),Math.min(this.y,point.y));};Point.prototype.max=function(point)
|
||||
{return new Point(Math.max(this.x,point.x),Math.max(this.y,point.y));};Point.prototype.inverse=function()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
moduleLoader.beginCacheLoading(["/script/shared/utils.js?v=105","/script/shared/gzip.js?v=105","/script/entities/graph/api/index.js?v=105","/script/shared/point.js?v=105","/script/entities/edge/api/index.js?v=105","/script/entities/edge/model/BaseEdge.js?v=105","/script/entities/edge/model/EdgeModel.js?v=105","/script/entities/vertex/api/index.js?v=105","/script/entities/vertex/model/BaseVertex.js?v=105","/script/entities/vertex/model/VertexModel.js?v=105","/script/entities/graph/model/Graph.js?v=105","/script/features/draw_graph/api/index.js?v=105","/script/features/draw_graph/model/BaseBackgroundDrawer.js?v=105","/script/features/draw_graph/model/EdgeStyle.js?v=105","/script/features/draw_graph/model/BaseEdgeDrawer.js?v=105","/script/features/draw_graph/model/VertexShape.js?v=105","/script/features/draw_graph/model/VertexStyle.js?v=105","/script/features/draw_graph/model/BaseVertexDrawer.js?v=105","/script/features/draw_graph/model/GraphFullStyle.js?v=105","/script/features/algorithms/api/index.js?v=105","/script/features/algorithms/model/Algorithms.js?v=105","/script/features/algorithms/model/BaseTraversal.js?v=105","/script/features/base_handler/index.js?v=105","/script/features/default_handler/index.js?v=105","/script/features/add_vertices_handler/index.js?v=105","/script/features/connect_vertices_handler/index.js?v=105","/script/features/delete_objects_handler/index.js?v=105","/script/features/algorithm_handler/index.js?v=105","/script/features/select_auto_save_graph_or_not/index.js?v=105","/script/features/graph_preview/index.js?v=105","/script/features/serialization/api/index.js?v=105","/script/features/serialization/model/GraphMLCreator.js?v=105","/script/features/enum_vertices/EnumVertices.js?v=105","/script/pages/editor/model/texts.js?v=105","/script/pages/editor/model/UndoStack.js?v=105","/script/pages/editor/model/DiskSaveLoad.js?v=105","/script/pages/editor/model/Application.js?v=105","/script/pages/editor/ui/ya_metrika.js?v=105","/script/pages/editor/ui/editor.js?v=105","/script/pages/editor/ui/main.js?v=105",]);{function onloadEditor(){console.log("onload() call");doIncludeAsync([include("shared/canvas2svg.min.js"),include("features/group_rename_handler/index.js"),include("features/saved_graph_handler/index.js"),include("features/saved_graph_image_handler/index.js"),include("features/show_adjacency_matrix/index.js"),include("features/show_distance_matrix/index.js"),include("features/show_incidence_matrix/index.js"),include("features/setup_background_style/index.js"),include("features/setup_edge_style/index.js"),include("features/setup_vertex_style/index.js"),]);postLoadPage();}
|
||||
moduleLoader.beginCacheLoading(["/script/shared/utils.js?v=106","/script/shared/gzip.js?v=106","/script/entities/graph/api/index.js?v=106","/script/shared/point.js?v=106","/script/entities/edge/api/index.js?v=106","/script/entities/edge/model/BaseEdge.js?v=106","/script/entities/edge/model/EdgeModel.js?v=106","/script/entities/vertex/api/index.js?v=106","/script/entities/vertex/model/BaseVertex.js?v=106","/script/entities/vertex/model/VertexModel.js?v=106","/script/entities/graph/model/Graph.js?v=106","/script/features/draw_graph/api/index.js?v=106","/script/features/draw_graph/model/BaseBackgroundDrawer.js?v=106","/script/features/draw_graph/model/EdgeStyle.js?v=106","/script/features/draw_graph/model/BaseEdgeDrawer.js?v=106","/script/features/draw_graph/model/VertexShape.js?v=106","/script/features/draw_graph/model/VertexStyle.js?v=106","/script/features/draw_graph/model/BaseVertexDrawer.js?v=106","/script/features/draw_graph/model/GraphFullStyle.js?v=106","/script/features/algorithms/api/index.js?v=106","/script/features/algorithms/model/Algorithms.js?v=106","/script/features/algorithms/model/BaseTraversal.js?v=106","/script/features/base_handler/index.js?v=106","/script/features/default_handler/index.js?v=106","/script/features/add_vertices_handler/index.js?v=106","/script/features/connect_vertices_handler/index.js?v=106","/script/features/delete_objects_handler/index.js?v=106","/script/features/algorithm_handler/index.js?v=106","/script/features/select_auto_save_graph_or_not/index.js?v=106","/script/features/graph_preview/index.js?v=106","/script/features/serialization/api/index.js?v=106","/script/features/serialization/model/GraphMLCreator.js?v=106","/script/features/enum_vertices/EnumVertices.js?v=106","/script/pages/editor/model/texts.js?v=106","/script/pages/editor/model/UndoStack.js?v=106","/script/pages/editor/model/DiskSaveLoad.js?v=106","/script/pages/editor/model/Application.js?v=106","/script/pages/editor/ui/ya_metrika.js?v=106","/script/pages/editor/ui/editor.js?v=106","/script/pages/editor/ui/main.js?v=106",]);{function onloadEditor(){console.log("onload() call");doIncludeAsync([include("shared/canvas2svg.min.js"),include("features/group_rename_handler/index.js"),include("features/saved_graph_handler/index.js"),include("features/saved_graph_image_handler/index.js"),include("features/show_adjacency_matrix/index.js"),include("features/show_distance_matrix/index.js"),include("features/show_incidence_matrix/index.js"),include("features/setup_background_style/index.js"),include("features/setup_edge_style/index.js"),include("features/setup_vertex_style/index.js"),]);postLoadPage();}
|
||||
let modulDir="pages/editor/";doInclude([include("shared/utils.js"),include("shared/gzip.js"),include("entities/graph/api/index.js"),include("features/draw_graph/api/index.js"),include("features/algorithms/api/index.js"),include("features/base_handler/index.js"),include("features/default_handler/index.js"),include("features/add_vertices_handler/index.js"),include("features/connect_vertices_handler/index.js"),include("features/delete_objects_handler/index.js"),include("features/algorithm_handler/index.js"),include("features/select_auto_save_graph_or_not/index.js"),include("features/serialization/api/index.js"),include("features/enum_vertices/EnumVertices.js"),include("model/texts.js",modulDir),include("model/UndoStack.js",modulDir),include("model/DiskSaveLoad.js",modulDir),include("model/Application.js",modulDir),include("ui/ya_metrika.js",modulDir),include("ui/editor.js",modulDir),include("ui/main.js",modulDir)],onloadEditor);}
|
||||
function gEncodeToHTML(str)
|
||||
{if(typeof str!=='string')
|
||||
@@ -17,7 +17,8 @@ function setDPIForCanvas(canvas,width,height){const dpr=window.devicePixelRatio|
|
||||
{canvas.style.width=Math.round(width)+"px";canvas.style.height=Math.round(height)+"px";}
|
||||
const ctx=canvas.getContext("2d");ctx.setTransform(dpr,0,0,dpr,0,0);}
|
||||
function getCanvasLogicWidth(canvas){const dpr=window.devicePixelRatio||1;return canvas.width/dpr;}
|
||||
function getCanvasLogicHeight(canvas){const dpr=window.devicePixelRatio||1;return canvas.height/dpr;};async function compress_text_into_zip_base64(str,callback,mode="gzip")
|
||||
function getCanvasLogicHeight(canvas){const dpr=window.devicePixelRatio||1;return canvas.height/dpr;}
|
||||
function getLogicToCanvasSize(size){const dpr=window.devicePixelRatio||1;return size*dpr;};async function compress_text_into_zip_base64(str,callback,mode="gzip")
|
||||
{try
|
||||
{const blobToBase64=blob=>new Promise((resolve,_)=>{const reader=new FileReader();reader.onloadend=()=>resolve(reader.result.split(',')[1]);reader.readAsDataURL(blob);});const byteArray=new TextEncoder().encode(str);const cs=new CompressionStream(mode);const writer=cs.writable.getWriter();writer.write(byteArray);writer.close();return await new Response(cs.readable).blob().then(blobToBase64).then(res=>callback(res));}
|
||||
catch(err)
|
||||
@@ -1790,8 +1791,7 @@ DiskSaveLoad.SaveGraphOnDisk(this.savedGraphName,graphAsString,function(msg)
|
||||
{document.cookie="graphName="+app.savedGraphName;app.removeAutosave();app.lastGraphName=app.savedGraphName;app.PushLastUsedGraph(app.savedGraphName);});}
|
||||
Application.prototype.SaveGraphImageOnDisk=function(showDialogCallback)
|
||||
{var imageName=this.GetNewName();this.stopRenderTimer();this.redrawGraph();var bbox=this.graph.getGraphBBox();var rectParams="";if(this.IsGraphFitOnViewport())
|
||||
{var canvasWidth=this.GetRealWidth();var canvasHeight=this.GetRealHeight();var canvasPositionInverse=this.canvasPosition.inverse();var pos=bbox.minPoint.subtract(canvasPositionInverse);rectParams="&x="+Math.round(pos.x*this.canvasScale)+"&y="+Math.round(pos.y*this.canvasScale)
|
||||
+"&width="+Math.round(bbox.size().x*this.canvasScale)+"&height="+Math.round(bbox.size().y*this.canvasScale);}
|
||||
{var canvasWidth=this.GetRealWidth();var canvasHeight=this.GetRealHeight();var canvasPositionInverse=this.canvasPosition.inverse();var pos=bbox.minPoint.subtract(canvasPositionInverse);rectParams="&x="+Math.round(getLogicToCanvasSize(pos.x)*this.canvasScale)+"&y="+Math.round(getLogicToCanvasSize(pos.y)*this.canvasScale)+"&width="+Math.round(getLogicToCanvasSize(bbox.size().x)*this.canvasScale)+"&height="+Math.round(getLogicToCanvasSize(bbox.size().y)*this.canvasScale);}
|
||||
var imageBase64Data=this.canvas.toDataURL();DiskSaveLoad.SaveGraphImageOnDisk(imageName,rectParams,imageBase64Data,showDialogCallback);return imageName;}
|
||||
Application.prototype.SaveFullGraphImageOnDisk=function(showDialogCallback,forPrint)
|
||||
{var imageName=this.GetNewName();this.stopRenderTimer();var canvas=forPrint?this._PrintRedrawGraph():this._OffscreenRedrawGraph();var bbox=this.graph.getGraphBBox();var rectParams="";rectParams="&x=0"+"&y=0"+"&width="+bbox.size().x+"&height="+bbox.size().y;var imageBase64Data=canvas.toDataURL();DiskSaveLoad.SaveGraphImageOnDisk(imageName,rectParams,imageBase64Data,showDialogCallback);return imageName;}
|
||||
@@ -2212,7 +2212,7 @@ document.getElementById('devToolsZoom').onclick=function()
|
||||
else
|
||||
{devTools["isMin"]=false;devTools.style.width="100%";}}
|
||||
document.getElementById('ExportGraph').onclick=function()
|
||||
{userAction(this.id);var graphAsString=self.application.graph.SaveToXML("");var savedGraphName=self.application.GetNewGraphName();var element=document.createElement('a');element.setAttribute('href','data:text/plain;charset=utf-8,'+encodeURIComponent(graphAsString));element.setAttribute('download',"graph_"+savedGraphName+".graphml");element.style.display='none';document.body.appendChild(element);element.click();document.body.removeChild(element);}
|
||||
{userAction(this.id);var graphAsString=self.application.graph.SaveToXML(self.application.SaveUserSettings());var savedGraphName=self.application.GetNewGraphName();var element=document.createElement('a');element.setAttribute('href','data:text/plain;charset=utf-8,'+encodeURIComponent(graphAsString));element.setAttribute('download',"graph_"+savedGraphName+".graphml");element.style.display='none';document.body.appendChild(element);element.click();document.body.removeChild(element);}
|
||||
document.getElementById('ImportGraph').onclick=function()
|
||||
{userAction(this.id);if(ImportGraphFiles){ImportGraphFiles.click();}}
|
||||
document.getElementById('openAlgorithmList').onclick=function()
|
||||
|
||||
@@ -1060,8 +1060,10 @@ Application.prototype.SaveGraphImageOnDisk = function (showDialogCallback)
|
||||
|
||||
var pos = bbox.minPoint.subtract(canvasPositionInverse);
|
||||
|
||||
rectParams = "&x=" + Math.round(pos.x * this.canvasScale) + "&y=" + Math.round(pos.y * this.canvasScale)
|
||||
+ "&width=" + Math.round(bbox.size().x * this.canvasScale) + "&height=" + Math.round(bbox.size().y * this.canvasScale);
|
||||
rectParams = "&x=" + Math.round(getLogicToCanvasSize(pos.x) * this.canvasScale) +
|
||||
"&y=" + Math.round(getLogicToCanvasSize(pos.y) * this.canvasScale) +
|
||||
"&width=" + Math.round(getLogicToCanvasSize(bbox.size().x) * this.canvasScale) +
|
||||
"&height=" + Math.round(getLogicToCanvasSize(bbox.size().y) * this.canvasScale);
|
||||
}
|
||||
|
||||
var imageBase64Data = this.canvas.toDataURL();
|
||||
|
||||
@@ -421,7 +421,7 @@ Editor.prototype.initButtonActions = function()
|
||||
{
|
||||
userAction(this.id);
|
||||
|
||||
var graphAsString = self.application.graph.SaveToXML("");
|
||||
var graphAsString = self.application.graph.SaveToXML(self.application.SaveUserSettings());
|
||||
var savedGraphName = self.application.GetNewGraphName();
|
||||
|
||||
var element = document.createElement('a');
|
||||
|
||||
@@ -95,4 +95,9 @@ function getCanvasLogicWidth(canvas) {
|
||||
function getCanvasLogicHeight(canvas) {
|
||||
const dpr = window.devicePixelRatio || 1;
|
||||
return canvas.height / dpr;
|
||||
}
|
||||
|
||||
function getLogicToCanvasSize(size) {
|
||||
const dpr = window.devicePixelRatio || 1;
|
||||
return size * dpr;
|
||||
}
|
||||
68
tpl/home.php
68
tpl/home.php
@@ -560,7 +560,20 @@
|
||||
|
||||
<div id="SetupVertexStyleDialog">
|
||||
<form class="pb-2">
|
||||
<fieldset>
|
||||
<fieldset>
|
||||
<div class="form-group row" id="VertexSelectedIndexForm">
|
||||
<label for="vertexSelectedIndex" class="col-sm-5 col-form-label"><?= L('selected_index')?></label>
|
||||
<div class="col-sm-5">
|
||||
<select id="vertexSelectedIndex" class="form-select">
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="all"><?= L('all')?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="vertexFillColor" class="col-sm-5 col-form-label"><?= L('common_color') ?></label>
|
||||
<div class="col-sm-5">
|
||||
@@ -608,7 +621,7 @@
|
||||
<div class="form-group row">
|
||||
<label for="commonTextPosition" class="col-sm-5 col-form-label"><?= L('text_position') ?></label>
|
||||
<div class="col-sm-5">
|
||||
<select id="commonTextPosition" class="form-control">
|
||||
<select id="commonTextPosition" class="form-select">
|
||||
<option value="0"><?= L('center') ?></option>
|
||||
<option value="1"><?= L('on_up') ?></option>
|
||||
</select>
|
||||
@@ -617,7 +630,7 @@
|
||||
<div class="form-group row">
|
||||
<label for="vertexShape" class="col-sm-5 col-form-label"><?= L('shape')?></label>
|
||||
<div class="col-sm-5">
|
||||
<select id="vertexShape" class="form-control">
|
||||
<select id="vertexShape" class="form-select">
|
||||
<option value="0"><?= L('circle')?></option>
|
||||
<option value="1"><?= L('squere')?></option>
|
||||
<option value="2"><?= L('triangle')?></option>
|
||||
@@ -632,11 +645,20 @@
|
||||
<div class="col-sm-5">
|
||||
<input type="number" class="form-control" id="vertexSize" placeholder="10" min="10" min="100">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="VertexSelectedIndexForm">
|
||||
<label for="vertexSelectedIndex" class="col-sm-5 col-form-label"><?= L('selected_index')?></label>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<canvas id="VertexPreview" width="350" height="150"></canvas>
|
||||
</div>
|
||||
|
||||
<div id="SetupEdgeStyleDialog">
|
||||
<form class="pb-2">
|
||||
<fieldset>
|
||||
<div class="form-group row" id="EdgeSelectedIndexForm">
|
||||
<label for="edgeSelectedIndex" class="col-sm-5 col-form-label"><?= L('selected_index')?></label>
|
||||
<div class="col-sm-5">
|
||||
<select id="vertexSelectedIndex" class="form-control">
|
||||
<select id="edgeSelectedIndex" class="form-select">
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
@@ -645,16 +667,7 @@
|
||||
<option value="all"><?= L('all')?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<canvas id="VertexPreview" width="300" height="150"></canvas>
|
||||
</div>
|
||||
|
||||
<div id="SetupEdgeStyleDialog">
|
||||
<form class="pb-2">
|
||||
<fieldset>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="edgeStrokeColor" class="col-sm-5 col-form-label"><?= L('common_color') ?></label>
|
||||
<div class="col-sm-5">
|
||||
@@ -688,7 +701,7 @@
|
||||
<div class="form-group row">
|
||||
<label for="weightTextPosition" class="col-sm-5 col-form-label"><?= L('weight_position') ?></label>
|
||||
<div class="col-sm-5">
|
||||
<select id="weightTextPosition" class="form-control" >
|
||||
<select id="weightTextPosition" class="form-select" >
|
||||
<option value="0"><?= L('center') ?></option>
|
||||
<option value="1"><?= L('on_up') ?></option>
|
||||
</select>
|
||||
@@ -705,7 +718,7 @@
|
||||
<div class="form-group row">
|
||||
<label for="edgeStyle" class="col-sm-5 col-form-label"><?= L('line_style') ?></label>
|
||||
<div class="col-sm-5">
|
||||
<select id="edgeStyle" class="form-control">
|
||||
<select id="edgeStyle" class="form-select">
|
||||
<option value="0">Solid</option>
|
||||
<option value="1">Dotted</option>
|
||||
<option value="2">Dashed</option>
|
||||
@@ -718,24 +731,11 @@
|
||||
<div class="col-sm-5">
|
||||
<input type="number" class="form-control" id="edgeWidth" placeholder="3" min="1" min="20">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" id="EdgeSelectedIndexForm">
|
||||
<label for="edgeSelectedIndex" class="col-sm-5 col-form-label"><?= L('selected_index')?></label>
|
||||
<div class="col-sm-5">
|
||||
<select id="edgeSelectedIndex" class="form-control">
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="all"><?= L('all')?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<canvas id="EdgePreview" width="300" height="150"></canvas>
|
||||
<canvas id="EdgePreview" width="350" height="150"></canvas>
|
||||
</div>
|
||||
|
||||
<div id="SetupBackgroundStyleDialog">
|
||||
|
||||
Reference in New Issue
Block a user