scaife-viewer / explorehomer

front-end for the Scaife "Explore Homer" prototype
https://scaife-viewer.org/
MIT License
4 stars 0 forks source link

Named Entity Map Mode #42

Closed paltman closed 4 years ago

paltman commented 4 years ago

What's in this PR?

Refactor reader mode composition

Map component changes

Other improvements

Screen Shot 2020-06-30 at 10 44 06 AM Screen Shot 2020-06-30 at 10 44 01 AM Screen Shot 2020-06-30 at 10 44 12 AM
paltman commented 4 years ago

Render all visible places within a passage on a map

jacobwegner commented 4 years ago

@paltman when you're able, could you please resolve merge conflicts again? I just did a few merges to develop this morning

paltman commented 4 years ago

Backport folio mode improvements to map mode

paltman commented 4 years ago

Synchronize named entity selection with the map

paltman commented 4 years ago

Restore error handlers

jacobwegner commented 4 years ago

@paltman Looking at how you've introduced ApolloQuery here, I'm wondering about an alternate approach to build up the "display mode" components.

Thinking from a Django perspective, I might have a BaseReaderView and override something in get_queryset to return data, and then a base_reader.html template that handles things like pagination controls, error messages, etc with a {% block reader_content %} for customizing the actual content displayed in a given mode.

In the current implementation, ApolloQuery that does serve sort of like a base_reader.html template, but then we have to read through else-if conditionals to know which content is to be loaded:

And then we jump into ImageModeReader to view the template.

If we want to tweak a particular query, we've got to hop over to queries.jsto tweak.

Instead, what if we were to:

e.g.

<Paginator :urn="data && data.previous" direction="left" />

<component :is="displayModeWidget" />

<Paginator :urn="data && data.next" direction="right" />

...

computed: {
  displayModeWidget(){ 
    if (this.imageMode) {
      return ImageDisplayModeReader
    }
    ...
  }
  ...
}

ReaderWidget is used to dispatch that displayModeWidget component, but the query and rendering are all the responsibility of the "child".

What do you think?

jacobwegner commented 4 years ago

(and to be clear, I’m discussing an alternate approach, not requesting we have to change the implementation on this branch)

jacobwegner commented 4 years ago

(and to be clear, I’m discussing an alternate approach, not requesting we have to change the implementation on this branch)