Skip to content

Interactive custom model editor improvements #250

Open

Description

@easbar

Continuing from graphhopper/graphhopper#2239 the following things could/should be improved:

  • allow negating areas using == false
  • check syntax for areas section (geojson)
  • support boolean encoded values without ==/!= true/false? This is important especially for, e.g. if: true, limit to: 100
  • auto-convert tabs to spaces, visualize space characters -> no longer needed since we use json now
  • fix missing auto completion for e.g. road_class ==| MOTORWAY && in_berlin
  • support negation operator !
  • support heading penalty
  • enable soft wraps? disable line numbers, disable error icons in left gutter
  • full screen for editor?
  • show 'no suggestions' popup instead of not showing anything when there are no suggestions?
  • auto-complete some values, like empty lists for speed/priority, type: Polygon/Feature, else: "" etc.
  • support areas defined in server-side profiles, does this even work?
  • auto-complete for YAML JSON, especially speed/priority/areas/distance_influence/limit_to/multiply_by would be nice
  • give better feedback for hard-to-find indentation errors (maybe use match brackets api to find closing bracket) -> not as critical for JSON anymore, we use match brackets though
  • enable close-brackets: https://codemirror.net/demo/closebrackets.html
  • catch YAML JSON syntax errors that aren't caught currently, e.g. {}[].
  • maybe trigger autocomplete automatically without pressing Ctrl+Space? At least in certain cases? This way maybe users not familiar with auto-complete get to know it more easily.
  • probably related to above: update (or close?) auto-complete popup when user keeps typing after it was opened?
  • auto-complete for numeric encoded values? maybe just show a hint saying that one needs to enter a number? show "type a number" as suggestion and insert nothing when user presses enter
  • tweak CM 'mode' especially indentation is not useful at all, e.g. for almost all cases it does the opposite of what we want, see here: https://codemirror.net/doc/manual.html#modeapi -> not as critical for json, and we use a black font for now since the default (red) seems a bit too much
  • simplify error messages (now that they are shown at their origin) ?
  • maybe use tooltips to provide some documentation, e.g. for speed/priority/distance_influence
  • make it easy to translate error messages? but first make them as simple as possible.
  • maybe use code mirror bracket matching
  • adjust colors, theme and styles
  • check code mirror options to see if we need anything besides the defaults, maybe customize the 'mode'?
  • handle YAML multiline syntax like >+ and |... https://stackoverflow.com/a/21699210 we use JSON now
  • dark theme and VIM keybindings (just kidding...)

Activity

  1. easbar commented on Apr 30, 2021

    @easbar
    MemberAuthor

    The font color (currently black) should be improved a bit maybe something like this:

    image

    Choosing the default json 'mode' was not so helpful, because the font was mostly red (too alarming) and the indentation did not work very well (see comment above).

  2. otbutz commented on Feb 17, 2025

    @otbutz
    Contributor

    support negation operator !

    This operator is used in most of our default custom models, which makes testing changes to them a bit tedious.

  3. easbar commented on Feb 17, 2025

    @easbar
    MemberAuthor

    I already implemented this here: graphhopper/custom-model-editor@5ebd805 I just updated the version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions