Skip to content

Commit 7440da0

Browse files
author
SeungpilPark
committed
#15 Data table reconnectEdge with single terminal
1 parent 0e04400 commit 7440da0

5 files changed

Lines changed: 77 additions & 76 deletions

File tree

src/main/webapp/examples/develope.html

Lines changed: 59 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,8 @@
357357
data.push({
358358
activity: '견적 TFT / EM' + i,
359359
'90_': [
360-
{type: 'activity', value: 'ITB 배포'}
360+
{type: 'activity', value: 'ITB 배포'},
361+
{type: 'activity', value: 'Reference PJT 선정'}
361362
],
362363
'85_': [
363364
{type: 'activity', value: 'Reference PJT 선정'}
@@ -389,66 +390,64 @@
389390
})
390391
}
391392

392-
$.get('resources/images/dids/dids-ed-svg.svg', function (data) {
393-
canvas.drawShape([200, 200], new OG.SvgShape(new XMLSerializer().serializeToString(data), 'BBB'), [200, 200],
394-
{
395-
fill: '#394',
396-
stroke: 'red',
397-
'stroke-width': '30'
398-
}
399-
);
400-
});
401-
402-
$.get('resources/images/dids/dids-activity.svg', function (data) {
403-
canvas.drawShape([400, 200], new OG.SvgShape(new XMLSerializer().serializeToString(data), 'BBB'), [200, 200],
404-
{
405-
fill: '#394',
406-
stroke: 'red',
407-
'stroke-width': '50'
408-
}
409-
);
410-
});
411-
412-
$.get('resources/images/dids/dids-folder.svg', function (data) {
413-
canvas.drawShape([600, 200], new OG.SvgShape(new XMLSerializer().serializeToString(data), 'BBB'), [200, 200],
414-
{
415-
fill: '#394',
416-
stroke: 'red',
417-
'stroke-width': '50'
418-
}
419-
);
420-
});
421-
422-
$.get('resources/images/dids/dids-doc.svg', function (data) {
423-
canvas.drawShape([200, 500], new OG.SvgShape(new XMLSerializer().serializeToString(data), 'BBB'), [200, 200],
424-
{
425-
fill: '#394',
426-
stroke: 'red',
427-
'stroke-width': '50'
428-
}
429-
);
430-
});
393+
var start = new Date();
394+
dataTable.MOVABLE = false;
395+
canvas.drawShape([100, 100], dataTable, [100, 100], {});
396+
dataTable.setData(data);
397+
dataTable.draw();
398+
var end = new Date();
399+
var number = end.getTime() - start.getTime();
400+
401+
// $.get('resources/images/dids/dids-ed-svg.svg', function (data) {
402+
// canvas.drawShape([200, 200], new OG.SvgShape(new XMLSerializer().serializeToString(data), 'BBB'), [200, 200],
403+
// {
404+
// fill: '#394',
405+
// stroke: 'red',
406+
// 'stroke-width': '30'
407+
// }
408+
// );
409+
// });
410+
//
411+
// $.get('resources/images/dids/dids-activity.svg', function (data) {
412+
// canvas.drawShape([400, 200], new OG.SvgShape(new XMLSerializer().serializeToString(data), 'BBB'), [200, 200],
413+
// {
414+
// fill: '#394',
415+
// stroke: 'red',
416+
// 'stroke-width': '50'
417+
// }
418+
// );
419+
// });
420+
//
421+
// $.get('resources/images/dids/dids-folder.svg', function (data) {
422+
// canvas.drawShape([600, 200], new OG.SvgShape(new XMLSerializer().serializeToString(data), 'BBB'), [200, 200],
423+
// {
424+
// fill: '#394',
425+
// stroke: 'red',
426+
// 'stroke-width': '50'
427+
// }
428+
// );
429+
// });
430+
//
431+
// $.get('resources/images/dids/dids-doc.svg', function (data) {
432+
// canvas.drawShape([200, 500], new OG.SvgShape(new XMLSerializer().serializeToString(data), 'BBB'), [200, 200],
433+
// {
434+
// fill: '#394',
435+
// stroke: 'red',
436+
// 'stroke-width': '50'
437+
// }
438+
// );
439+
// });
440+
//
441+
// $.get('resources/images/dids/dids-dwg.svg', function (data) {
442+
// canvas.drawShape([400, 500], new OG.SvgShape(new XMLSerializer().serializeToString(data), 'BBB'), [200, 200],
443+
// {
444+
// fill: '#394',
445+
// stroke: 'red',
446+
// 'stroke-width': '50'
447+
// }
448+
// );
449+
// });
431450

432-
$.get('resources/images/dids/dids-dwg.svg', function (data) {
433-
canvas.drawShape([400, 500], new OG.SvgShape(new XMLSerializer().serializeToString(data), 'BBB'), [200, 200],
434-
{
435-
fill: '#394',
436-
stroke: 'red',
437-
'stroke-width': '50'
438-
}
439-
);
440-
});
441-
// canvas.drawShape([300, 300], new OG.ImageShape('resources/images/dids/dids-ed-svg.svg'), [400, 400],
442-
// {r: '10'}
443-
// );
444-
445-
// var start = new Date();
446-
// dataTable.MOVABLE = false;
447-
// canvas.drawShape([100, 100], dataTable, [100, 100], {});
448-
// dataTable.setData(data);
449-
// dataTable.draw();
450-
// var end = new Date();
451-
// var number = end.getTime() - start.getTime();
452451

453452

454453
//

src/main/webapp/opengraph/OpenGraph-0.1.2-SNAPSHOT-All.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/opengraph/OpenGraph-0.1.2-SNAPSHOT-min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/opengraph/OpenGraph-0.1.2-SNAPSHOT.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17739,7 +17739,8 @@ OG.shape.component.DataTable.prototype.addCellContent = function (cellView, cont
1773917739
}
1774017740
me.data.viewData.rows[data.rowIndex].cells[data.column]['contents'].move(beforeIndex, newIndex);
1774117741
me.data.viewData.rows[data.rowIndex].cells[data.column]['value'].move(beforeIndex, newIndex);
17742-
me.data.tableData[data.rowDataIndex][data.column].move(beforeIndex, newIndex);
17742+
me.data.tableData[data.rowDataIndex][data.column] =
17743+
JSON.parse(JSON.stringify(me.data.viewData.rows[data.rowIndex].cells[data.column]['value']));
1774317744
me.redrawCell(me.refreshCellView(cellView));
1774417745
}
1774517746
}
@@ -17816,12 +17817,12 @@ OG.shape.component.DataTable.prototype.reconnectEdgesToContent = function (cellV
1781617817
if (direction == 'from') {
1781717818
shapeId = fromTerminal.substring(0, fromTerminal.indexOf(OG.Constants.TERMINAL));
1781817819
replace = fromTerminal.replace(shapeId, contentElement.id);
17819-
me.currentCanvas.getRenderer().connect(replace, toTerminal, edge, null, null, true);
17820+
me.currentCanvas.getRenderer().connect(replace, null, edge, null, null, true);
1782017821
}
1782117822
if (direction == 'to') {
1782217823
shapeId = toTerminal.substring(0, toTerminal.indexOf(OG.Constants.TERMINAL));
1782317824
replace = toTerminal.replace(shapeId, contentElement.id);
17824-
me.currentCanvas.getRenderer().connect(fromTerminal, replace, edge, null, null, true);
17825+
me.currentCanvas.getRenderer().connect(null, replace, edge, null, null, true);
1782517826
}
1782617827
}
1782717828
me.data.viewData.rows[data.rowDataIndex].cells[data.column]['connection'] = [];
@@ -18825,19 +18826,19 @@ OG.shape.component.DataTable.prototype.onCellResize = function (cell, offset) {
1882518826

1882618827
if (cellView.type == 'column') {
1882718828
//뷰 데이터의 columnHeight 를 변경한다.
18828-
if(me.options.resizeAxis != 'X'){
18829+
if (me.options.resizeAxis != 'X') {
1882918830
me.data.viewData.columnHeight = boundary.getHeight();
1883018831
}
1883118832
}
1883218833
else if (cellView.type == 'cell') {
1883318834
//뷰 데이터의 rowHeight 를 변경한다.
18834-
if(me.options.resizeAxis != 'X'){
18835+
if (me.options.resizeAxis != 'X') {
1883518836
me.data.viewData.rows[rowIndex].rowHeight = boundary.getHeight();
1883618837
}
1883718838
}
1883818839

1883918840
//뷰 칼럼의 width 를 변경한다.
18840-
if(me.options.resizeAxis != 'Y'){
18841+
if (me.options.resizeAxis != 'Y') {
1884118842
var columnViews = me.data.viewData.columns;
1884218843
columnViews[column].width = boundary.getWidth();
1884318844

@@ -18888,7 +18889,7 @@ OG.shape.component.DataTable.prototype.onAddToGroup = function (groupElement, el
1888818889
//콘텐트의 중심을 포함한 셀을 찾는다.
1888918890
var centroid = me.currentCanvas.getBoundary(element).getCentroid();
1889018891
dropCell = me.getCellViewFromOffset([centroid.x, centroid.y]);
18891-
if(dropCell && dropCell.type == 'column'){
18892+
if (dropCell && dropCell.type == 'column') {
1889218893
dropCell = null;
1889318894
}
1889418895

src/main/webapp/src/shape/component/DataTable.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,8 @@ OG.shape.component.DataTable.prototype.addCellContent = function (cellView, cont
631631
}
632632
me.data.viewData.rows[data.rowIndex].cells[data.column]['contents'].move(beforeIndex, newIndex);
633633
me.data.viewData.rows[data.rowIndex].cells[data.column]['value'].move(beforeIndex, newIndex);
634-
me.data.tableData[data.rowDataIndex][data.column].move(beforeIndex, newIndex);
634+
me.data.tableData[data.rowDataIndex][data.column] =
635+
JSON.parse(JSON.stringify(me.data.viewData.rows[data.rowIndex].cells[data.column]['value']));
635636
me.redrawCell(me.refreshCellView(cellView));
636637
}
637638
}
@@ -708,12 +709,12 @@ OG.shape.component.DataTable.prototype.reconnectEdgesToContent = function (cellV
708709
if (direction == 'from') {
709710
shapeId = fromTerminal.substring(0, fromTerminal.indexOf(OG.Constants.TERMINAL));
710711
replace = fromTerminal.replace(shapeId, contentElement.id);
711-
me.currentCanvas.getRenderer().connect(replace, toTerminal, edge, null, null, true);
712+
me.currentCanvas.getRenderer().connect(replace, null, edge, null, null, true);
712713
}
713714
if (direction == 'to') {
714715
shapeId = toTerminal.substring(0, toTerminal.indexOf(OG.Constants.TERMINAL));
715716
replace = toTerminal.replace(shapeId, contentElement.id);
716-
me.currentCanvas.getRenderer().connect(fromTerminal, replace, edge, null, null, true);
717+
me.currentCanvas.getRenderer().connect(null, replace, edge, null, null, true);
717718
}
718719
}
719720
me.data.viewData.rows[data.rowDataIndex].cells[data.column]['connection'] = [];
@@ -1717,19 +1718,19 @@ OG.shape.component.DataTable.prototype.onCellResize = function (cell, offset) {
17171718

17181719
if (cellView.type == 'column') {
17191720
//뷰 데이터의 columnHeight 를 변경한다.
1720-
if(me.options.resizeAxis != 'X'){
1721+
if (me.options.resizeAxis != 'X') {
17211722
me.data.viewData.columnHeight = boundary.getHeight();
17221723
}
17231724
}
17241725
else if (cellView.type == 'cell') {
17251726
//뷰 데이터의 rowHeight 를 변경한다.
1726-
if(me.options.resizeAxis != 'X'){
1727+
if (me.options.resizeAxis != 'X') {
17271728
me.data.viewData.rows[rowIndex].rowHeight = boundary.getHeight();
17281729
}
17291730
}
17301731

17311732
//뷰 칼럼의 width 를 변경한다.
1732-
if(me.options.resizeAxis != 'Y'){
1733+
if (me.options.resizeAxis != 'Y') {
17331734
var columnViews = me.data.viewData.columns;
17341735
columnViews[column].width = boundary.getWidth();
17351736

@@ -1780,7 +1781,7 @@ OG.shape.component.DataTable.prototype.onAddToGroup = function (groupElement, el
17801781
//콘텐트의 중심을 포함한 셀을 찾는다.
17811782
var centroid = me.currentCanvas.getBoundary(element).getCentroid();
17821783
dropCell = me.getCellViewFromOffset([centroid.x, centroid.y]);
1783-
if(dropCell && dropCell.type == 'column'){
1784+
if (dropCell && dropCell.type == 'column') {
17841785
dropCell = null;
17851786
}
17861787

0 commit comments

Comments
 (0)