SchweizerischeBundesbahnen / netzgrafik-editor-frontend

The Netzgrafik-Editor is a powerful software that enables the creation, modification, and analysis of regular-interval timetable.
https://schweizerischebundesbahnen.github.io/netzgrafik-editor-frontend/
Other
32 stars 10 forks source link

[Feature request]: Node (Betriebspunkt / Operational point) name unicity #205

Open louisgreiner opened 3 months ago

louisgreiner commented 3 months ago

Preflight Checklist

Request type

Request for enhancement of a component (Node constructor).

Functionality

Context

According to business structures, a Node BP is unique.

However, currently a Node (Betriebspunkt or BP in german, Operational Point or OP in english for business) can have the same name and shortname, for instance :

In the code, the nodes are identified by the id, but for the user, who doesn't have access to the ids, it can be confusing, especially in the graphic timetable (Streckengrafik)

Solution

User can choose (or not) to enable node unicity at any time in a scenario.

It could be a box to check in the Settings menu.

The box would be only enabled (or visible) when all the nodes of the variants are unique. If not, the box is disabled and a message explains why on mouse hover (or simply not visible).

Consequence : if node unicity is true, when a user creates a node that has the same name / shortname than another one (open discussion), we can:

Questions

Examples

Invalid combinations of nodes:

[
  { "fullName": "Zuerich", "betriebspunktName": "ZUE" },
  { "fullName": "Zuerich", "betriebspunktName": "ZUE" },
  { "fullName": "Paris-Gare-de-Lyon", "betriebspunktName": "PLY/BV" },
  { "fullName": "Paris-Gare-de-Lyon", "betriebspunktName": "PLY/BV" }
]

Valid combinations of nodes:

[
  { "fullName": "Zuerich", "betriebspunktName": "ZUE" },
  { "fullName": "Zürich", "betriebspunktName": "ZUE" },
  { "fullName": "Paris-Gare-de-Lyon", "betriebspunktName": "PLY/BV" },
  { "fullName": "Paris-Gare-de-Lyon", "betriebspunktName": "PLY/AG" }
]

Link to design proposal file

No response

aiAdrian commented 2 months ago

General

It might be a good idea to only display the "unique" checkbox if this option is activated in the application's environment, otherwise, it adds more complexity to the Netzgrafik-Editor with respect to the standard way of working, which should be avoided. In many applications, such as quickly trying out ideas, it does not matter if the node names are unique because the created data will not be shared with third parties.

Answer question - what should be unique

I recommend that only the short name be unique, such as 0085BN (0085 Switzerland / BN: Bern). However, we could have more than one "Bern" – How should the operation point be encoded: encodable country code + short name / or unique UIC operation point code.

Validation (current version) - what might improve usability of Netzgrafik-Editor

In the current version, the user can still encode the node's short name to be unique, but there is no double-check/validation available. This missing validation of uniqueness makes the Netzgrafik-Editor easy to use but quite complicated for exchanging data with third parties. Thus it might be worthfull having a validator in the current system, which "flags" all node's short names that are not unique with a warning element - but allow them to exist.

Next steps