Giter VIP home page Giter VIP logo

razorness / vue3-calendar-heatmap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from julienr114/vue-calendar-heatmap

84.0 2.0 16.0 860 KB

A lightweight calendar heatmap Vue 3 component built on SVG, inspired by julienr114's vue-calendar-heatmap and github's contribution calendar graph

Home Page: https://razorness.github.io/vue3-calendar-heatmap

License: MIT License

Vue 47.09% TypeScript 52.04% HTML 0.87%

vue3-calendar-heatmap's Introduction

vue3-calendar-heatmap's People

Contributors

julienr114 avatar jwigley avatar mtfum avatar natescarlet avatar paradisewitch avatar razorness avatar thomasleveil 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  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  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

vue3-calendar-heatmap's Issues

Dates Off by 1 Day

My data has string dates (YYYY-MM-DD) however, when fed into component, they are being rendered as one day prior. Could this be a timezone issue with how the component is handling dates?

Screenshot 2023-04-23 at 8 18 28 AM

Screenshot 2023-04-23 at 8 18 37 AM

Cannot read properties of undefined (reading 'weekCount')

<template>
  <div>
    <calendar-heatmap
      :values="values"
      :end-date="values.endDate"
      :tooltip-unit="values.picked" />
  </div>
</template>

<script lang="ts">
  import {computed, defineComponent} from 'vue'
  import {CalendarHeatmap} from 'vue3-calendar-heatmap'

  export default defineComponent({
    components: {
      CalendarHeatmap,
    },
    props: {
      data: {
        type: Array,
        default: () => [
          {
            date: '2018-09-28',
            count: 1,
          },
        ],
      },
    },
    setup(props) {
      const values = computed(() => {
        return {
          values: props.data,
          endDate: new Date('2021-08-01'),
          picked: 'Dings',
        }
      })

      return {
        values,
      }
    },
  })
</script>

props data send

const dataExample = [
  {
    date: '2020-11-30T23:00:00Z',
    count: 635000,
  },
  {
    date: '2020-12-02T23:00:00Z',
    count: 2442000,
  },
]

TypeError: Cannot read properties of undefined (reading 'map')

I am pretty new to Vue, and when I followed the instructions to import the component locally:

<template>
<CalendarHeatmap></CalendarHeatmap>
</template>
import { CalendarHeatmap } from 'vue3-calendar-heatmap'
export default {
    components: {
        CalendarHeatmap
    },
    // ...
}

I got the error Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'map')?

Thank you for the help in advance :)

Object.hasOwn is not a function

I'm getting a lot of these errors in my production app, but cannot reproduce locally.

Maybe the stack trace rings a bell?

Screenshot 2023-03-19 at 18 05 18

feature: empty data change color

Hi, Can you improve on this?
:emty-value="0" :emtpy-bg-color="#ffff" etc.

because dark/light website used. default emtpy value and color change

or rangeColor[0] add svg class vch__day__square vch__day__square__null

Some issues with heatmap

Hi,

First, thanks for this valuable repository.

We have implemented the heatmap in a project, we provide "values" and "end-date" but can't see the data visualized in the heatmap.

Also, does the "round" attribute work? It seems like doesn't work on my end.

One last thing, is this repo support NuxtJS?

Thanks,
Omer

Failed to resolve entry for package

Getting this error in v2.0.1 with Nuxt 3, v2.0.0 works fine.

Failed to resolve entry for package "vue3-calendar-heatmap". The package may have incorrect main/module/exports specified in its package.json.

dark mode not turning on?

First off, great library! This is exactly what I've been looking for for the last 2 days and it's imo by far and away one of the best out there

Just having an issue turning dark mode on and i'm not sure why...

This is my code:

                <calendar-heatmap
                    :dark-mode="dark"
                    :values="values"
                    :end-date="endDate"
                    :no-data-text="false" />

///////////////////////////

    data() {
        return {
            values: [
                {
                    date: '2020-11-30T23:00:00Z',
                    count: 635000
                }, 
               // ....
            ],
            endDate: new Date('2021-08-01'),
            picked: 'Dings',
            orientation: 'horizontal',
            dark: true
        };
    },

Can't quite figure out what I'm doing wrong. I tried to inspect the code but I couldn't seem to find anything related to dark-mode so I may be misunderstanding the functionality

Alternatively I'll look to just change the theme to suit my required colors :)

Thanks

Option to treat 0 and null the same

I think it does not make much sense to treat 0 and null different like the module currently does.

If one wants to treat them the same using 7-color colorRange, there is a issue in the legend rendering when where the two colors are listed twice and the legend being cut-off because the module can not correctly handle 7 colors in it:

image

I think the only clean way to solve is to have a boolean option that makes 0 and null equal color so colorRange can be defined using six colors.

See go-gitea/gitea#22157 for more details and a workaround I've added to fix the legend rendering.

endDate bug only shows 1969 year

So basically even though i give the component the ":end-date" parameter it shows me the dates only between Dec 29, 1968 and Jan 3 1970.

<calendar-heatmap :end-date="2023-12-12" :values="[{ date: '1969-6-6', count: 6 }]" dark-mode/>

Is it possible this is a bug?

contribs

`height` option

It would be useful if one could pass in a height option and the module would lay out the content inside that height as it sees fit. This would allow to reliably reserve content space to avoid a layout shift when the component loads.

feature: footer should be div slot

Github footer example. Please add :)

  • hidden header month title props
  • hidden monday/tuesday title props
  • footer left right slot
  • less/more design left - right slot custom write add etc.

CleanShot 2021-12-01 at 13 43 54@2x

CleanShot 2021-12-01 at 13 45 31@2x

Disable Legend

Hello thank you for this great project. I would like to leave a suggestion for improvement: add a prop to allow disabling the legend.

thank you!

Colors don't seem to match legend when specifying rangeColor

This is an example heatmap from a Gitea instance I am using:
image
As far as I can tell, Gitea does not specify a max value, but range-color (see https://github.com/go-gitea/gitea/blob/main/web_src/js/components/ActivityHeatmap.vue), but in this heatmap there is no day in the "highest" category (5), only one day in category 4, which seems to be unintended behavior.

Also please consider this example from this project's documentation: https://razorness.github.io/vue3-calendar-heatmap/#example-1
image
The color for the single day with highest contribution count does not appear in the legend, and the "lowest" color in the legend does not appear in the map.

tailwindcss support

On the design side, I think you can open special classes for tailwindcss.
example
:bg-color="bg-red-500"

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.