mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2025-06-11 18:43:22 +02:00
Merged in web2d-coreJS-solutions (pull request #5)
Core-js, web2d and mindplot working baseline * fix .eslintignore remove Raphael dependency * Fix to avoid crashes in _plotPrediction whitout Raphael * Fix minplot basic code inspections * Fix last inspections errors * Inital refactor copying files * Clean up. * Fix web2d cyclic dependencies remove only-warn eslint plugin set import/no-extraneous-dependencies to warn (incorrectly complaining about root package) * Fix web2d Point references (no need to assign it to core) Fix web2d imports in mindplot and update Point refs * Merge 'feature/mindplot_tests' into web2d-coreJS-solutions * mindplot fixes and add viewmode.html playground setup playground config to run the map-render examples fix mindplot components export mootools Static was not working so refactored it fix some references to _peer fix messages __bundle undefined add web2d missing export: Image downgrade cypress to avoid SIGSEGV error Approved-by: Paulo Veiga
This commit is contained in:
committed by
Paulo Veiga
parent
c89d40758a
commit
cb2ca74a20
@ -30,13 +30,13 @@
|
||||
overflowWorkspace.setSize("200px", "200px");
|
||||
var arrow = new web2d.Arrow();
|
||||
arrow.setFrom(50, 50);
|
||||
arrow.setControlPoint(new core.Point(-50, 0));
|
||||
arrow.setControlPoint(new web2d.Point(-50, 0));
|
||||
|
||||
overflowWorkspace.append(arrow);
|
||||
|
||||
var arrow2 = new web2d.Arrow();
|
||||
arrow2.setFrom(100, 50);
|
||||
arrow2.setControlPoint(new core.Point(50, 50));
|
||||
arrow2.setControlPoint(new web2d.Point(50, 50));
|
||||
|
||||
overflowWorkspace.append(arrow2);
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { default as web2D } from '../../lib/web2d';
|
||||
import Grid from './utils';
|
||||
import web2d from '../../src/web2d';
|
||||
|
||||
global.web2d = web2D();
|
||||
global.Grid = Grid;
|
||||
global.web2d = web2d;
|
||||
|
@ -31,16 +31,16 @@
|
||||
line1.setStyle(web2d.CurvedLine.SIMPLE_LINE);
|
||||
line1.setFrom(200, 200);
|
||||
line1.setTo(100, 100);
|
||||
line1.setSrcControlPoint(new core.Point(-100, 0));
|
||||
line1.setDestControlPoint(new core.Point(100, 0));
|
||||
line1.setSrcControlPoint(new web2d.Point(-100, 0));
|
||||
line1.setDestControlPoint(new web2d.Point(100, 0));
|
||||
overflowWorkspace.append(line1);
|
||||
|
||||
var line2 = new web2d.CurvedLine();
|
||||
line2.setStyle(web2d.CurvedLine.NICE_LINE);
|
||||
line2.setFrom(0, 0);
|
||||
line2.setTo(150, 90);
|
||||
line2.setSrcControlPoint(new core.Point(100, 0));
|
||||
line2.setDestControlPoint(new core.Point(-100, 0));
|
||||
line2.setSrcControlPoint(new web2d.Point(100, 0));
|
||||
line2.setDestControlPoint(new web2d.Point(-100, 0));
|
||||
overflowWorkspace.append(line2);
|
||||
|
||||
overflowWorkspace.addItAsChildTo($('#overflowExample').first());
|
||||
|
@ -273,4 +273,4 @@
|
||||
</table>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
@ -11,18 +11,18 @@
|
||||
<div>
|
||||
<h1>Testing</h1>
|
||||
<ul>
|
||||
<li><a href="/arrow">Arrow</a></li>
|
||||
<li><a href="/curvedLine">Curved Line</a></li>
|
||||
<li><a href="/events">Events</a></li>
|
||||
<li><a href="/font">Font</a></li>
|
||||
<li><a href="/group">Group</a></li>
|
||||
<li><a href="line">Line</a></li>
|
||||
<li><a href="/polyLine">Poly Line</a></li>
|
||||
<li><a href="/prototype">Prototype</a></li>
|
||||
<li><a href="/rect">Rect</a></li>
|
||||
<li><a href="/shapes">Shapes</a></li>
|
||||
<li><a href="/text">Text</a></li>
|
||||
<li><a href="/workspace">Workspace</a></li>
|
||||
<li><a href="/arrow.html">Arrow</a></li>
|
||||
<li><a href="/curvedLine.html">Curved Line</a></li>
|
||||
<li><a href="/events.html">Events</a></li>
|
||||
<li><a href="/font.html">Font</a></li>
|
||||
<li><a href="/group.html">Group</a></li>
|
||||
<li><a href="/line.html">Line</a></li>
|
||||
<li><a href="/polyLine.html">Poly Line</a></li>
|
||||
<li><a href="/prototype.html">Prototype</a></li>
|
||||
<li><a href="/rect.html">Rect</a></li>
|
||||
<li><a href="/shapes.html">Shapes</a></li>
|
||||
<li><a href="/text.html">Text</a></li>
|
||||
<li><a href="/workspace.html">Workspace</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -47,7 +47,6 @@
|
||||
text.setColor(fontColor);
|
||||
textot = text;
|
||||
|
||||
|
||||
overflowWorkspace.addItAsChildTo(document.getElementById(owner));
|
||||
|
||||
var parent = document.getElementById(owner);
|
||||
@ -111,4 +110,4 @@
|
||||
<input type="button" value="Zoom In" onclick="zoomIn()">
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
@ -1,59 +1,60 @@
|
||||
/*
|
||||
* Copyright [2015] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const Grid = function (parent, colums, rows) {
|
||||
var cellSize = '10px';
|
||||
this._parent = parent;
|
||||
this._container = this._createContainer();
|
||||
var tbody = $(this._container.firstChild.firstChild);
|
||||
for (var i = 0; i < rows; i++) {
|
||||
var trElement = $('<tr></tr>');
|
||||
for (var j = 0; j < colums; j++) {
|
||||
var tdElement = $('<td></td>');
|
||||
tdElement.css({
|
||||
width: cellSize,
|
||||
height: cellSize,
|
||||
borderWidth: '1px',
|
||||
borderStyle: 'dashed',
|
||||
borderColor: 'lightsteelblue',
|
||||
});
|
||||
trElement.append(tdElement);
|
||||
}
|
||||
tbody.append(trElement);
|
||||
}
|
||||
};
|
||||
|
||||
Grid.prototype.setPosition = function (x, y) {
|
||||
this._container.style.left = x;
|
||||
this._container.style.top = y;
|
||||
};
|
||||
|
||||
Grid.prototype.render = function () {
|
||||
$(this._parent).append(this._container);
|
||||
};
|
||||
|
||||
Grid.prototype._createContainer = function () {
|
||||
var result = window.document.createElement('div');
|
||||
result.style.tableLayout = 'fixed';
|
||||
result.style.borderCollapse = 'collapse';
|
||||
result.style.emptyCells = 'show';
|
||||
result.style.position = 'absolute';
|
||||
result.innerHTML =
|
||||
'<table style="table-layout:fixed;border-collapse:collapse;empty-cells:show;"><tbody id="tableBody"></tbody></table>';
|
||||
return result;
|
||||
};
|
||||
/*
|
||||
* Copyright [2015] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const Grid = function (parent, colums, rows) {
|
||||
const cellSize = '10px';
|
||||
this._parent = parent;
|
||||
this._container = this._createContainer();
|
||||
const tbody = $(this._container.firstChild.firstChild);
|
||||
for (let i = 0; i < rows; i++) {
|
||||
const trElement = $('<tr></tr>');
|
||||
for (let j = 0; j < colums; j++) {
|
||||
const tdElement = $('<td></td>');
|
||||
tdElement.css({
|
||||
width: cellSize,
|
||||
height: cellSize,
|
||||
borderWidth: '1px',
|
||||
borderStyle: 'dashed',
|
||||
borderColor: 'lightsteelblue',
|
||||
});
|
||||
trElement.append(tdElement);
|
||||
}
|
||||
tbody.append(trElement);
|
||||
}
|
||||
};
|
||||
|
||||
Grid.prototype.setPosition = function (x, y) {
|
||||
this._container.style.left = x;
|
||||
this._container.style.top = y;
|
||||
};
|
||||
|
||||
Grid.prototype.render = function () {
|
||||
$(this._parent).append(this._container);
|
||||
};
|
||||
|
||||
Grid.prototype._createContainer = function () {
|
||||
const result = window.document.createElement('div');
|
||||
result.style.tableLayout = 'fixed';
|
||||
result.style.borderCollapse = 'collapse';
|
||||
result.style.emptyCells = 'show';
|
||||
result.style.position = 'absolute';
|
||||
result.innerHTML = '<table style="table-layout:fixed;border-collapse:collapse;empty-cells:show;"><tbody id="tableBody"></tbody></table>';
|
||||
return result;
|
||||
};
|
||||
|
||||
export default Grid;
|
||||
|
@ -23,7 +23,6 @@
|
||||
web2d.peer.utils = {};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="utils.js"></script>
|
||||
<script type="text/javascript">
|
||||
function initialize() {
|
||||
web2d.Toolkit.init();
|
||||
@ -61,10 +60,10 @@
|
||||
// Draw a reference grid.
|
||||
|
||||
// Enable when JS is loading ...
|
||||
// var container = document.getElementById("sizeExampleContainer");
|
||||
// var grid = new Grid(container, 35, 12);
|
||||
// grid.setPosition("0px", "0px")
|
||||
// grid.render();
|
||||
var container = document.getElementById("sizeExampleContainer");
|
||||
var grid = new Grid(container, 35, 12);
|
||||
grid.setPosition("0px", "0px")
|
||||
grid.render();
|
||||
|
||||
// Define a workspace using pixels and inchs.
|
||||
var workspacePixel = new web2d.Workspace();
|
||||
@ -327,4 +326,4 @@
|
||||
</table>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user