Giter VIP home page Giter VIP logo

Comments (8)

wwwy3y3 avatar wwwy3y3 commented on May 22, 2024 2

@chihsuan https://github.com/Canner/vega-canner-components
here you go.

from cannercms.

abz53378 avatar abz53378 commented on May 22, 2024 1

Thanks, @chihsuan, <indicator> is a great name!

The <datePicker> is excatly an important tag, thx for point it out . But I still need some time to dig into it (maybe have other pickers?, or different tags design?, etc).

About the data flow of components, I will open another issue to discuss the implementation. But in brief, these components will fetch the data by themselves. For examples, this is a simple example of react-apollo, you can use <Query> component to fetch the data with the given graphql query (the graphql property in our case) and the variables(the date filter object in our case)

/**
const where = {
  date_gt: 2018-08-17T04:17:25Z
}
const grahpql = `
  query AggregateOrders($where: WhereInput!) {
    aggregateOrders(where: $where) {
      count
    }
  }
`
**/

// our <indicator> components
const Amount = ({ where,  graphql }) => (
  <Query query={gql`${graphql}`} variables={{ where }}>
    {({ loading, error, data }) => {
      if (loading) return null;
      if (error) return `Error!: ${error}`;

      return (
        <div >
           {data.aggregateOrders.count}
        <div/>
      );
    }}
  </Query>
);

from cannercms.

chihsuan avatar chihsuan commented on May 22, 2024

@abz53378: Thanks for writing down the spec. How about to use<metrics>, <indicator> or just <card> instead of <display> ? Because <display> might be more likely to consider as a verb which is not consistent with other tags.

And we might still need to have a new tag for picking the time range of data. Like Google Analytics. I think it would be like a container tag which can contain other UI tags but currently, I'm not sure how to control data flow. It might be like:

<datepicker options={} default="" showDelta={true}>
      <display ui="list" graphql={``} />
</datepicker>

screen shot 2018-08-17 at 12 00 01 pm

from cannercms.

chilijung avatar chilijung commented on May 22, 2024

Agree with @chihsuan, tags should be more specific the better, cause we might adding additional tags in the future.

+1 for indicator

from cannercms.

chihsuan avatar chihsuan commented on May 22, 2024

@abz53378: As we discussed, I'm trying to implement new chart tags. I am going to create a chart model in canner-script. Since we would need to wrap react-vega components as our components. Should we have a repo for chart components like antd-canner-components to map the chart tag to its component?

from cannercms.

chilijung avatar chilijung commented on May 22, 2024

from cannercms.

chihsuan avatar chihsuan commented on May 22, 2024

@chilijung: Thank you for the quick reply. Sure, vega-canner-components looks good. But could you please help to create it? I don't have the permission to do that. It's okay to take your time. I can implement new chart tags first since the repo name is determined. Thanks!

from cannercms.

abz53378 avatar abz53378 commented on May 22, 2024

Merged, so I closed it.

from cannercms.

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.