Angularで作るER DIAGRAM TOOL – 第十五回 modelにpositionを持たせる & Upload JSON機能追加

Allows you to import JSON output with the function you added last time.

First, since the position information of the model was not saved in the previous export,
We will give the model position information.

(1) Addition of position information of model


· Add pos_x, pos_y


– Drag start / end processing was the same, but it was divided into startDrag () and endDrag ().


· To access HTML elements, import ElementRef as import
· When dragging is completed, the current position information is acquired and saved.

You now have location information for the model.

(2) Create a modal for JSON upload


· When you select a file, parse the data and acquire it.


(3) a modal call for JSON upload. And addition to the module


· Added ModalUploadComponent to module



(4) A modal call for JSON upload. And addition to the module


· GetSchemaById () now returns null if there is no corresponding Schema.
· When model_data is given at model creation, it is modified to create new on the basis of the data


· When schema_data is given at the time of schema generation, it is modified to create new based on the data

(5) Add all jsPlumb endpoint deletion function


· Add deleteAll ()

(6) Data load function implementation



· Fixed getModel — and getSchema — and other functions. Changed to return null if there is no target.
· Add clearData ()
· LoadData () addition

(7) Model position information reflection processing addition


Fix to make model pos_x / pos_y synchronize with style position

(8) Modal closing process addition


· Modified to close the modal when download JSON

JSON can now be uploaded.

There are still many functions I want to add,
Once in this state, I would like to release it.

Thank you for those who have read this far.
And finally, thanks so much.