Code Monkey home page Code Monkey logo

Comments (6)

VictorVelarde avatar VictorVelarde commented on August 20, 2024 1

@eamador I think there is another relevant piece here to verify. When dealing with client-side widgets, this addition to sources wouldn't change the type of results, so I'm assuming client-side calculations should work the same.

But when using widgets in global mode, a request is done to //v3/sql/${source.connection}/model/${model}`; See packages/react-api/src/api/model.js and my question would be: don't we need to send also queryParameters to that endpoint? If we don't do it so, I guess that we would send just templated query in source, is that right?

https://cartoteam.slack.com/archives/C03JJHB2GRL/p1658450619238119?thread_ts=1658450533.766699&cid=C03JJHB2GRL

from carto-react.

padawannn avatar padawannn commented on August 20, 2024 1

Yes, the requests to model service need to include the queryParameters. The query template is only usable by builder so no service should work with the queryTemple. C4R always should work with the original query, never with the query template.

The histogram and range widgets call to the Stats API that also needs to include the queryParameters.

Remember that in builder we also call the Stats API we must include the queryParameters in these calls

from carto-react.

eamador avatar eamador commented on August 20, 2024 1

Keeping in mind this comments i have created a draft PR so that you could start a quick review and confirm it's ok.

@VictorVelarde @padawannn

from carto-react.

eamador avatar eamador commented on August 20, 2024

I am not sure if i miss something, @padawannn could you please help here in order to define what changes we need to do and where?

We'd also need to clarify how widgets should behave, for instance in the global mode..

Thank you!

from carto-react.

VictorVelarde avatar VictorVelarde commented on August 20, 2024

LGTM. On redux modifying addSource to include in queryParameters should be enough. For useCartoLayerProps, we have a SourceProps type where this addition fits.

from carto-react.

VictorVelarde avatar VictorVelarde commented on August 20, 2024

Already implemented and released. Nice work @eamador

from carto-react.

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.