Giter Site home page Giter Site logo

Comments (7)

nanaeaubry avatar nanaeaubry commented on June 3, 2024

@knoopum Great suggestion I will work on putting this in. For now the workaround about looking at the node is the best way but we can add a property or make it so the method returns a theme if no parameters are given :)

from arcgis-python-api.

knoopum avatar knoopum commented on June 3, 2024

I'll note a complication I ran into is that StoryMap Collections, which can also reference Themes, are not currently accessible via the API. Passing an item ID for a StoryMap Collection to arcgis.apps.storymap.StoryMap() results in a 404.

For Collections, it looks like I will have to harvest the Theme info from the item's JSON for now?

from arcgis-python-api.

nanaeaubry avatar nanaeaubry commented on June 3, 2024

@knoopum Good news for collections! Support will be added at 2.3.0 (coming out next week) so you will be able to access them soon. However the theme property you are suggesting was not added so it will be in Storymap, Collections, and Briefings for 2.3.1

I would refer to the json for now. I will make a custom method and can post it here soon as well to facilitate this.

from arcgis-python-api.

knoopum avatar knoopum commented on June 3, 2024

@nanaeaubry that is great! I'll scrape the JSON in the meantime, and look forward to the updates

from arcgis-python-api.

nanaeaubry avatar nanaeaubry commented on June 3, 2024

Here is a quick method that can be used to get the theme

def get_theme(story):
    """
    Get the theme of the story, briefing, or collection.
    """

    for node, node_info in story._properties["resources"].items():
        for key, val in node_info.items():
            if key == "type" and val == "story-theme":
                return story._properties["resources"][node]["data"]["themeId"]

This will either return the name or the itemid of the theme used

from arcgis-python-api.

knoopum avatar knoopum commented on June 3, 2024

@nanaeaubry Thank you! that confirms the logic I ended up using

from arcgis-python-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.