Re: [terriajs] How to modify what the Workbench displays given a new model?

291 views
Skip to first unread message

Kevin Ring

unread,
Aug 28, 2018, 3:11:38 AM8/28/18
to TerriaJS
Hi Jose,

We don't (yet) have a plugin point for this, so you'll need to modify TerriaJS itself. You'll need to follow the instructions here to set up your development environment to use a modified version of TerriaJS:

Because TerriaJS master is using a newer version of Cesium right now, there's an extra step that unfortunately isn't documented on the page above (I need to fix this). You need to do one of these two things:
1. Check out TerriaJS v6.0.5 instead of master after cloning the terriajs repo into packages/terriajs: `cd packages/terriajs && git checkout 6.0.5`.
2. Sync the TerriaMap dependencies to match TerriaJS. From the root TerriaMap directory: `npm install -g sync-dependencies && sync-dependencies --source terriajs --from packages/terriajs/package.json && rm -rf node_modules && npm install`.

Once that it set up, you'll need to start by modifying this file, adding a new component inside the `<If condition={workbenchItem.isLegendVisible}>` block:

Your new component's render function can simply return null if it doesn't make sense to show your new controls for the given catalog item.

To disable the display variable selection, you'll want to add some new logic to the ConceptViewer component:

Hope that helps, let me know if you have any questions.
Kevin


On Sat, Aug 25, 2018 at 11:59 PM, Jose Castanheira <j.cast...@campus.fct.unl.pt> wrote:
Hi, thank you all for the help beforehand. 
I'm trying to create a modified version of TerriaJS for a very specific goal. In this, I need to be able to modify what the Workbench shows (the column on the left with all information and proprieties about the dataset), only for a new type of model.
What I'm looking for is, given a CSV with a specific format, display a list of all the objects (rows) present in the file, even if no coordinates are given for it, and using a pre-defined display variable (so no Display Variable input).

What kind of files do I have to modify for this? I want to be able to display regular CSV files the same way, but this modified format would be shown in a personalized way. I'm new to all of this, so any help is greatly appreciated!

--
You received this message because you are subscribed to the Google Groups "TerriaJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terriajs+unsubscribe@googlegroups.com.
To post to this group, send email to terr...@googlegroups.com.
Visit this group at https://groups.google.com/group/terriajs.
For more options, visit https://groups.google.com/d/optout.



--

Kevin Ring

unread,
Aug 28, 2018, 3:11:58 AM8/28/18
to TerriaJS
By the way, we'd be very interested to hear more about what you're working on!

Jose Castanheira

unread,
Sep 3, 2018, 5:33:53 PM9/3/18
to terr...@googlegroups.com
Hello, thank you so much for your detailed answer! I already had followed the documentation and have been editing TerriaJS, experimenting here and there.
I guess my main problem is that I'm new to React so I should spend some time learning that in the meantime. Thank you for pointing out to the exact components I should modify. I'll come back if I have any other questions.
What I'm working on is a visualization system for cultural heritage objects that are retrieved through a catalog function. This allows anyone to search for these objects in a map.

Jose Castanheira

unread,
Sep 11, 2018, 2:27:47 PM9/11/18
to terr...@googlegroups.com
I'm having a new kind of trouble now. I had already created a new catalogue function and it was working fine, but when I decided to run "npm run gulp", it changed the items.json and it now presents the "Unsupported catalogue item type" for the new catalogue type. Do you know what can be causing this? Did I do something different this time?

Kevin Ring

unread,
Sep 12, 2018, 7:32:25 AM9/12/18
to TerriaJS
Hi, did you (or someone you work with) ask this question on Gitter too?

One possible problem is that you didn't register the new catalog item in registerCatalogMembers.js. If that's not the problem, check that node_modules/terriajs is still a symlink to packages/terriajs. It could be that yarn has replaced the symlink with an installed copy because of a terriajs version change. The terriajs version listed in TerriaMap's package.json has to exactly match the "version" property in packages/terriajs/package.json.

Kevin

Jose Castanheira

unread,
Sep 15, 2018, 3:07:28 PM9/15/18
to TerriaJS
Thanks, the problem was with the symlink, I had managed to erase it somehow.
To unsubscribe from this group and stop receiving emails from it, send an email to terriajs+u...@googlegroups.com.

To post to this group, send email to terr...@googlegroups.com.
Visit this group at https://groups.google.com/group/terriajs.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "TerriaJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terriajs+u...@googlegroups.com.

To post to this group, send email to terr...@googlegroups.com.
Visit this group at https://groups.google.com/group/terriajs.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "TerriaJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terriajs+u...@googlegroups.com.

To post to this group, send email to terr...@googlegroups.com.
Visit this group at https://groups.google.com/group/terriajs.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages