mobie / mobie.github.io

1 stars 3 forks source link

Spec for additional view #43

Closed constantinpape closed 3 years ago

constantinpape commented 3 years ago

Currently, in the new spec additional views can be added like this:

misc/bookmarks/some_file.json

And some_file.json looks like this:

{
"bookmarks": {
  "name1": {...},
  ...
}
}

Where the entries follow the view spec.

I think we should rename all of this to views so that we don't include the term bookmark in the spec any longer, i.e.

misc/views/some_file.json
{
"views": {...}
}

Let me know what you think @tischi.

p.s. we don't have an example for additional views yet, I will add it once we decide on this so it can be tested in the viewer.

tischi commented 3 years ago

Sure! Sounds good.

In my code it looks like I could easily add more views from different locations:

    public Map< String, View > getViews()
    {
        final HashMap< String, View > views = new LinkedHashMap<>();

                // combine the individual source views...
        for ( String sourceName : dataset.sources.keySet() )
        {
            views.put( sourceName, dataset.sources.get( sourceName ).get().view );
        }

        // ...with the additional views
        views.putAll( dataset.views );

        return views;
    }
tischi commented 3 years ago

I think we should rename all of this to views so that we don't include the term bookmark in the spec any longer

yes

constantinpape commented 3 years ago

Done. @tischi I added an example for the extra views here: https://github.com/mobie/zebrafish-lm-datasets/blob/spec-v2/data/membrane/misc/views/more_grid_views.js