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

VisConfigFile Default Behavior #30

Open
munoztd0 opened this issue Sep 9, 2024 · 4 comments
Open

VisConfigFile Default Behavior #30

munoztd0 opened this issue Sep 9, 2024 · 4 comments
Labels
enhancement New feature or request graphic-walker graphic-walker level issue (github.com/Kanaries/graphic-walker)

Comments

@munoztd0
Copy link

munoztd0 commented Sep 9, 2024

Little question, I'm trying to set some custom values on the VisConfigFiles, i.e. PrimaryColor, Colorpalatte etc..

So i'm exporting the config.json as adviced but I would like it to be flexible for any kind of data.. so I remove the specifics dimensions and measures.. But if I do that, the GWalkR doesn't render anymore ..

If I don't, it just shows the exact same viz with the same data, which is not what I want to do obviously..

Does it make sense what I am trying to do ? and is there a way to achieve it ?

Thanks again

@ObservedObserver
Copy link
Member

ObservedObserver commented Sep 11, 2024

You can remove some of the dimensions and measures, but not those in the charts.

dimensions and measures are used to render the field options on the leftside of gwalkr, for example, you got

dimensions = [d1, d2, d3]
measures = [m1, m2]

your_chart = {
  "x": d1,
  "y": m1
}

You can remove d2, d3, m2 since they are not in the chart, but it will causes other users won't be able to use those removed variables for visualization.

But if you remove d1 or m1, which are contained in the chart, the chart should not render, I think. It tries to use some variables not in the meta data, which is not we expected.

For the specification in the config.json is in pretty early stage, there might be some redundent information in it, and we will consider to optimize it soon.

@munoztd0
Copy link
Author

munoztd0 commented Sep 11, 2024

mhhh I don't think that quite what is was saying though..

what i mean is :

this is the config.json I export from the UI:

[
    {
        "config": {
            "defaultAggregated": false,
            "geoms": ["auto"],
            "coordSystem": "generic",
            "limit": -1
        },
        "encodings": {
            "dimensions": [
                {
                    "fid": "bmFtZQ==",
                    "name": "name",
                    "basename": "name",
                    "semanticType": "nominal",
                    "analyticType": "dimension"
                },
                {
                    "fid": "aGFpcl9jb2xvcg==",
                    "name": "hair_color",
                    "basename": "hair_color",
                    "semanticType": "nominal",
                    "analyticType": "dimension"
                },
                {
                    "fid": "c2tpbl9jb2xvcg==",
                    "name": "skin_color",
                    "basename": "skin_color",
                    "semanticType": "nominal",
                    "analyticType": "dimension"
                },
                {
                    "fid": "ZXllX2NvbG9y",
                    "name": "eye_color",
                    "basename": "eye_color",
                    "semanticType": "nominal",
                    "analyticType": "dimension"
                },
                {
                    "fid": "c2V4",
                    "name": "sex",
                    "basename": "sex",
                    "semanticType": "nominal",
                    "analyticType": "dimension"
                },
                {
                    "fid": "Z2VuZGVy",
                    "name": "gender",
                    "basename": "gender",
                    "semanticType": "nominal",
                    "analyticType": "dimension"
                },
                {
                    "fid": "aG9tZXdvcmxk",
                    "name": "homeworld",
                    "basename": "homeworld",
                    "semanticType": "nominal",
                    "analyticType": "dimension"
                },
                {
                    "fid": "c3BlY2llcw==",
                    "name": "species",
                    "basename": "species",
                    "semanticType": "nominal",
                    "analyticType": "dimension"
                },
                {
                    "fid": "gw_mea_key_fid",
                    "name": "Measure names",
                    "analyticType": "dimension",
                    "semanticType": "nominal"
                }
            ],
            "measures": [
                {
                    "fid": "aGVpZ2h0",
                    "name": "height",
                    "basename": "height",
                    "analyticType": "measure",
                    "semanticType": "quantitative",
                    "aggName": "sum"
                },
                {
                    "fid": "bWFzcw==",
                    "name": "mass",
                    "basename": "mass",
                    "analyticType": "measure",
                    "semanticType": "quantitative",
                    "aggName": "sum"
                },
                {
                    "fid": "YmlydGhfeWVhcg==",
                    "name": "birth_year",
                    "basename": "birth_year",
                    "analyticType": "measure",
                    "semanticType": "quantitative",
                    "aggName": "sum"
                },
                {
                    "fid": "gw_count_fid",
                    "name": "Row count",
                    "analyticType": "measure",
                    "semanticType": "quantitative",
                    "aggName": "sum",
                    "computed": true,
                    "expression": {
                        "op": "one",
                        "params": [],
                        "as": "gw_count_fid"
                    }
                },
                {
                    "fid": "gw_mea_val_fid",
                    "name": "Measure values",
                    "analyticType": "measure",
                    "semanticType": "quantitative",
                    "aggName": "sum"
                }
            ],
            "rows": [],
            "columns": [],
            "color": [],
            "opacity": [],
            "size": [],
            "shape": [],
            "radius": [],
            "theta": [],
            "longitude": [],
            "latitude": [],
            "geoId": [],
            "details": [],
            "filters": [],
            "text": []
        },
        "layout": {
            "showActions": false,
            "showTableSummary": false,
            "stack": "stack",
            "interactiveScale": false,
            "zeroScale": true,
            "size": {
                "mode": "auto",
                "width": 320,
                "height": 200
            },
            "format": {},
            "geoKey": "name",
            "resolve": {
                "x": false,
                "y": false,
                "color": false,
                "opacity": false,
                "shape": false,
                "size": false
            },
            "scaleIncludeUnmatchedChoropleth": false,
            "showAllGeoshapeInChoropleth": false,
            "colorPalette": "greenBlue",
            "useSvg": false,
            "scale": {
                "opacity": {},
                "size": {}
            },
            "primaryColor": "rgba(153,0,239,0.58)"
        },
        "visId": "gw_Pyvk",
        "name": "Chart 1"
    }
]

But I don't want to just redo this graph, I just want GWalkR session to start with the same defaults I chose, i.e. "defaultAggregated": false

But if I just pass this config (removing the dimensions and measures .. the whole thing freezes and nothing is outputed.

[
    {
        "config": {
            "defaultAggregated": false,
            "geoms": ["auto"],
            "coordSystem": "generic",
            "limit": -1,
            "encodings": {
                "rows": [],
                "columns": [],
                "color": [],
                "opacity": [],
                "size": [],
                "shape": [],
                "radius": [],
                "theta": [],
                "longitude": [],
                "latitude": [],
                "geoId": [],
                "details": [],
                "filters": [],
                "text": []
            }
        },
        "layout": {
            "showActions": false,
            "showTableSummary": false,
            "stack": "stack",
            "interactiveScale": false,
            "zeroScale": true,
            "size": {
                "mode": "auto",
                "width": 320,
                "height": 200
            },
            "format": {},
            "geoKey": "name",
            "resolve": {
                "x": false,
                "y": false,
                "color": false,
                "opacity": false,
                "shape": false,
                "size": false
            },
            "scaleIncludeUnmatchedChoropleth": false,
            "showAllGeoshapeInChoropleth": false,
            "colorPalette": "greenBlue",
            "useSvg": false,
            "scale": {
                "opacity": {},
                "size": {}
            },
            "primaryColor": "rgba(153,0,239,0.58)"
        },
        "visId": "gw_Pyvk",
        "name": "Chart 1"
    }
]

My bigger question is just : Am I making a mistake somewhere or is it just not supported ?

Thanks again for your hard work !

@ObservedObserver ObservedObserver added enhancement New feature or request graphic-walker graphic-walker level issue (github.com/Kanaries/graphic-walker) labels Sep 13, 2024
@ObservedObserver
Copy link
Member

I get it, you want some default settings for the gwalkr UI. like setting the default aggreted to be true or setting the stack mode to be center by default.

It was a feature we discussed in graphic-walker, will be released within two weeks.

@munoztd0
Copy link
Author

Nice ! Let me know, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request graphic-walker graphic-walker level issue (github.com/Kanaries/graphic-walker)
Projects
None yet
Development

No branches or pull requests

2 participants