SCADA-LTS / Scada-LTS

Scada-LTS is an Open Source, web-based, multi-platform solution for building your own SCADA (Supervisory Control and Data Acquisition) system.
GNU General Public License v2.0
745 stars 292 forks source link

Create a Helper to arrange points in graphical view by coordenates #1718

Open sselvaggi opened 3 years ago

sselvaggi commented 3 years ago

// define the element ids of points we want to arrange const block1 = ["c1", "c2", "c3", "c4"] const block2 = ["c5", "c6", "c7", "c8"]

// and then iterate over them to set the position coordenates

block1 .map(id => document.getElementById) .reduce(absoluteGrid, {x: 100, y: 150, deltaX: 0, deltaY: 20 })

block2 .map(id => document.getElementById) .reduce(absoluteGrid, {x: 500, y: 150, deltaX: 0, deltaY: 20 })

celsou commented 3 years ago

I don't know if Scada-LTS still uses the interface for Graphic Views inherited from ScadaBR, but for ScadaBR I created a Javascript library that brings functions for alignment in Graphic View. Here is the repository for this library: https://github.com/celsou/fuscabr FuscaBR alignment

(Sorry for the lack of documentation for this library, unfortunately I'm short on time to write the documentation)

I hope it's useful.