mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2025-06-11 18:43:22 +02:00
Increase coverage migrating tests.
This commit is contained in:
committed by
Paulo Veiga
parent
695dd71921
commit
25b86f3cff
29
packages/mindplot/test/playground/lib/raphael-plugins.js
Normal file
29
packages/mindplot/test/playground/lib/raphael-plugins.js
Normal file
@ -0,0 +1,29 @@
|
||||
Raphael.fn.drawGrid = function (x, y, w, h, wv, hv, color) {
|
||||
color = color || '#999';
|
||||
let path = ['M', x, y, 'L', x + w, y, x + w, y + h, x, y + h, x, y];
|
||||
const rowHeight = h / hv;
|
||||
const columnWidth = w / wv;
|
||||
for (var i = 0; i < hv + 1; i++) {
|
||||
var offset = y + i * rowHeight;
|
||||
path = this.path(['M', x, offset, 'L', x + w, y + i * rowHeight]);
|
||||
if (offset == 0 || offset == h) {
|
||||
path.attr({ stroke: '#000' });
|
||||
} else if (offset == h / 2) {
|
||||
path.attr({ stroke: '#c00' });
|
||||
} else {
|
||||
path.attr({ stroke: '#999' });
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < wv + 1; i++) {
|
||||
var offset = x + i * columnWidth;
|
||||
path = this.path(['M', offset, y, 'L', x + i * columnWidth, y + h]);
|
||||
if (offset == 0 || offset == w) {
|
||||
path.attr({ stroke: '#000' });
|
||||
} else if (offset == w / 2) {
|
||||
path.attr({ stroke: '#c00' });
|
||||
} else {
|
||||
path.attr({ stroke: '#999' });
|
||||
}
|
||||
}
|
||||
return this.path;
|
||||
};
|
Reference in New Issue
Block a user