Giter Site home page Giter Site logo

Comments (2)

bianchimro avatar bianchimro commented on June 20, 2024

hi @mikima yes, it's possible by just throwing a js error in your render function

throw new Error("Hello error")

that renders like this:

Screenshot 2021-01-11 at 21 54 02

There was a problem showing the error in the frontend, I just fixed it here
https://github.com/rawgraphs/rawgraphs-frontend/commit/9a539ce16c9b794c1675991f94e459b6bc932208
(still needs some styling, but there was a positioning issues and the error was sometimes hidden)

Your specific use case is covered by the dimensions api. When you declare a dimension, you can set minValues and maxValues properties (indipendently) to require/limit the maximum number of values that can be mapped on a multiple dimension.
Like:

export const dimensions = [
  {
    id: 'axes',
    name: 'spokes',
    validTypes: ['number'],
    required: true,
    multiple: true,
    minValues: 2,
    aggregation: true,
    aggregationDefault: {
      number: 'sum',
      string: 'csvDistinct',
      date: 'csvDistinct',
    },
  },
  ...
]

This should the way to do it but:

  • It's not documented (sorry, working on this!)
  • The frontend at the moment does not show this kind of error. This is a mapping error that forbids render, so it's not even shown under the artboard like the error in the screenshot above. We should decide if it should be shown here or in the mapping section.
    Personally, I'd show it in the mapped dimension, that is also much easier to implement at the moment

from rawgraphs-charts.

mikima avatar mikima commented on June 20, 2024

Great! Thanks

from rawgraphs-charts.

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.