Giter Site home page Giter Site logo

weblogin / trendchart-elements Goto Github PK

View Code? Open in Web Editor NEW
41.0 4.0 6.0 610 KB

Web components to generate simple charts representing trends

Home Page: https://weblogin.github.io/trendchart-elements/demo/

License: MIT License

JavaScript 3.00% TypeScript 97.00%
trend chart lit responsive web-component

trendchart-elements's People

Contributors

mushr0000m avatar peterpan666 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

trendchart-elements's Issues

How can I use this package with svelte?

Wondering if anyone has experience on how I could import this library using svelte.

the tc- tags don't work with the import statement neither the hover tooltip

<script lang="ts">
  import '@weblogin/trendchart-elements';

</script>

<tc-column
	class="h-full w-full p-4 pt-0 [--shape-color:oklch(var(--pc))]"
	values="[12,10,12,4,13,16,14,10,12,11,17,18,16,17,20,14,15,13,12,14]"
	min="0"
	shape-radius="4"
	shape-gap="4"
></tc-column>

Here is a repl to demo the issue:
https://svelte.dev/repl/d56f19987687410dba37ef055124c6e4?version=4.2.0

Thanks!

Capturing click event

Hello! Great library :)

Is it possible to capture a click event? I am trying to execute a function when I click on part of a graph (for example a bar from a bar graph).

Cheers.

Use the library inside a jsx/tsx component

Hi, I would like to ask if is possible in some way to use your library inside a JSX/TSX component. I'm trying to use it in my code but I encountered an error.

To reproduce

  1. install the package
    npm install @weblogin/trendchart-elements

  2. import a chart
    import { TcLine } from "@weblogin/trendchart-elements";

  3. create a component

import { TcColumn } from "@weblogin/trendchart-elements"

export default function Page() {
  return (
    <main>
      <div>
       <TcColumn />
      </div>
    </main>
  )
} 

The error encountered is the following:

'TcColumn' cannot be used as a JSX component.
Its type 'typeof TcColumn' is not a valid JSX element type.
Types of construct signatures are incompatible.
Type 'new () => TcColumn' is not assignable to type 'new (props: any, deprecatedLegacyContext?: any) => Component<any, any, any>'.
Type 'TcColumn' is missing the following properties from type 'Component<any, any, any>': context, setState, forceUpdate, props, and 2 more.

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.