Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(How) can we visualize the data in resource node and in the data package node? #26

Closed
DenoBeno opened this issue Jul 23, 2019 · 11 comments
Assignees
Labels
BB: Data Package Tool Data Package Export and Import Tool Building Block enhancement New feature or request on-hold Issue is on-hold and will be addressed later

Comments

@DenoBeno
Copy link

I just noticed a ticked stating that that react components (data visualization widgets) need to be somehow changed (ticket in "map-component - #clarity-h2020/map-component#37).

This reminded me that it would be good to imediately visualize the contents of the resource and/or data package outside of a study. One advantage of this woudl be that the users who are adding resources/data packages would have imediate feedback on what they did and know if they did it correctly or not. Another would be that we would have a simpler & more flexible way to visualiize the data on the site - not hard coded for the needs of the study.

(1) How to add visualization widgets to nodes?

Adding a visualization widget to a dp_ressource and other node types would be relatively easy to do. Two possibilities:

  1. Write an "Entity View Attachment" view that finds the necessary visualization widget and embeds it in the dp_resource display
  2. Let the user defining the resource also choose a visualization. This could be done by defining the visualization nodes containing the javascript applicaitons first and then letting the user choose one or more of them with an entity briwser and linking them to the resource node.

I can easily add such functions, the only problem is this:

(2) How do our widgets know what data to show?

Ideally , our "visualization widgets" would be exactly the same for resources, for data packages and for the studies. Let's take the map widget for example:

  1. How does it know what to show when displayed on a specific place in the study today?
  2. How could we make this more flexible so that the same widget can be also used in dp_resources, in dp_package or wherever else we need it?

I'm afraid that today they are looking at the path where they were called and then do some magic to get the relevant data for displaying it today. If they would e.g. look for some hidden variables on the page where they were called, it would be easier to make them work wherever necessary.

Example: a map widget could be passed the bounding box and a list of the resource node IDs and then show all the map layers from al lthe resources that it got at initialization time.

WDYT?

@p-a-s-c-a-l p-a-s-c-a-l added the on-hold Issue is on-hold and will be addressed later label Jul 23, 2019
@p-a-s-c-a-l
Copy link
Member

The Map Component needs a study. It fetches the study area from the JSON API extracts the study area, EMIKAT internal ID of the study, and the data package resources relevant for the the current step. So, without study, no map.

@DenoBeno
Copy link
Author

That's unfortunate.

@p-a-s-c-a-l p-a-s-c-a-l added the enhancement New feature or request label Jul 26, 2019
@DenoBeno
Copy link
Author

DenoBeno commented Aug 2, 2019

What's interesting is that resources have a spatial_extent variable - we just aren't using it. And it's not a geofield.

For testing, I have added a geofield field "bounding box". Unfortunately, there is no widget to edit it on a map like https://boundingbox.klokantech.com/. Or maybe there is, but it's in "alpha" https://www.drupal.org/project/leaflet_widget

So I entered some data per hand and the result is in principle OK
image

This field could be used to initialize any map view, but entering the data is a PITA.

Hiding it again - until better times...

@p-a-s-c-a-l
Copy link
Member

Unfortunately, the spatial extent is not enough. When retrieving data from the EMIKAT APIs, we need a $emikat_id which is an equivalent of the $study_id. Some or even all data in EMIKAT is generated on the fly for each new study. So we cannot access it from outside the context of a study.

@p-a-s-c-a-l
Copy link
Member

In principle, this feature is now available. However, in order to activate it, I need access to data package uuid, resource uuid, etc. in the CSIS helpers Module. ATM I can just access the fields of the study group node. See clarity-h2020/csis-helpers-module#10 (comment)

Furthermore, the respective Maps (node type: Extended iFrame) have to be included in the View Mode Forms. I tried it with the default study group edit form, which is usually not used by end users:

grafik

But in the edit form, the map is not rendered automatically:

grafik

Anyway, this is a map that shows all WMS Resources available in a data package that is associated with the study 3f3a0772-5d55-4f5b-9c7f-fe0a2321d11d. If clarity-h2020/csis-helpers-module#10 (comment) has been implemented, we can add such maps to data packages and single resources.

@DenoBeno
Copy link
Author

I took a look at this, and I feel that we may need @fgeyer16 here.

The preview is based on this node: https://csis.myclimateservice.eu/node/1032

The preview node can be included in a group, as shown here: https://csis.myclimateservice.eu/group/17/edit

image

However, the preview of rendered entity in edit mode doesn't seem to work at all. E.g.:

image

image

I suppose @fgeyer16 would need to look at this.

Map works OK in standard view mode. I have enabled it now in the data view mode of the group

image

@therter , @p-a-s-c-a-l : could you add a title of a currently active map layer in the view?

@DenoBeno
Copy link
Author

I have tried to do the same with the data package, but it's currently not loading any layers.

See e.g. https://csis.myclimateservice.eu/node/682

@p-a-s-c-a-l
Copy link
Member

p-a-s-c-a-l commented Aug 27, 2019

I have tried to do the same with the data package, but it's currently not loading any layers.

Yes, because there still only the study id available in `$entityInfo' of CSIS helpers. See clarity-h2020/csis-helpers-module#10 (comment)

I have enabled it now in the data view mode of the group

Do you really want to show the map with all layers available? Because the layers are context dependent shown in the different steps, too.

could you add a title of a currently active map layer in the view?

No, that's not possible. Information on selected layers is not available in this context (3rd party library).

@DenoBeno
Copy link
Author

@p-a-s-c-a-l : i have enabled it as a proof of concept. In my opinion, it would make far more sense to have this in the data package (in resource?) than in the study, but I added it to demonstrate that it works.

@DenoBeno
Copy link
Author

DenoBeno commented Sep 6, 2019

I understand that this should more or less work now?

@p-a-s-c-a-l
Copy link
Member

yes

@p-a-s-c-a-l p-a-s-c-a-l added the BB: Data Package Tool Data Package Export and Import Tool Building Block label Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BB: Data Package Tool Data Package Export and Import Tool Building Block enhancement New feature or request on-hold Issue is on-hold and will be addressed later
Projects
None yet
Development

No branches or pull requests

5 participants