Giter Club home page Giter Club logo

easy-circular-progress's Introduction

Codacy Badge All Contributors codecov License: MIT npm Build Status FOSSA Status Greenkeeper badge Known Vulnerabilities

easy-circular-progress

Install

npm install easy-circular-progress --save

Quick Start

<template>
  <div id="app">
    <Progress value="16.88">
      <!-- <template v-slot:footer>
        <b>goood</b>
      </template>-->
    </Progress>
    <Progress strokeColor="#FF00AA" value="16.88">
      <template v-slot:footer>
        <b>More Color</b>
      </template>
    </Progress>

    <Progress :radius="50" :strokeWidth="10" value="86.12">
      <template v-slot:footer>
        <b>Bolder & Bigger One</b>
      </template>
    </Progress>

    <Progress
      :transitionDuration="5000"
      :radius="50"
      :strokeWidth="10"
      value="86.12"
    >
      <template v-slot:footer>
        <b>Slow One</b>
      </template>
    </Progress>

    <Progress
      :transitionDuration="5000"
      :radius="55"
      :strokeWidth="10"
      value="86.12567"
    >
      <template v-slot:footer>
        <b>More Precise</b>
      </template>
    </Progress>

    <Progress :transitionDuration="5000" :radius="55" :strokeWidth="10" value="86.12567">
      <div class="content">hello</div>
      <template v-slot:footer>
        <b>More Precise</b>
      </template>
    </Progress>
  </div>
</template>

<script>
import Progress from "easy-circular-progress";

export default {
  name: "app",
  components: {
    Progress
  }
};
</script>

<style lang="scss">
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  height: 100vh;
  color: #fff;
  background: #3e423a;
  display: flex;
  justify-content: center;
  align-items: center;
}
body {
  margin: 0;
  padding: 0;
}
</style>

Prop Types

Property Type Required? Description
strokeWidth Number default is 4, the width of the progress circle, the bigger the bolder
radius Number the inner circle radius, default is 38
transitionDuration Number default is 1000, transitionDuration for the animation
strokeColors String default is "#aaff00"
value Number | String default is 0.0, should be less or equal then 100

Slot

Slot Name Description
footer we can add a footer for the circle
default the content displayed in the circle

if default slot provided, the coutdown effect will be ignored.

Advance Guide

Customized Theme

  • In your customized scss file (demo.scss)
$--circular-progress-int-fz: 28px;
$--circular-progress-dec-fz: 12px;
@import '~easy-circular-progress/src/index';
  • import the scss to override the default theme in main.js (entry file) before you import the Draw component
import './demo.scss';

variables

We split the number into two parts (int, dec) We can define the font-size for each part

  • $--circular-progress-int-fz: 28px;
  • $--circular-progress-dec-fz: 12px;

Possibly Polyfill

Number.isNaN =
  Number.isNaN ||
  function(value) {
    return value !== value;
  };

License

FOSSA Status

Contributors

Thanks goes to these wonderful people (emoji key):

Vincent Guo
Vincent Guo

πŸ’» πŸ“– πŸš‡

This project follows the all-contributors specification. Contributions of any kind welcome!

easy-circular-progress's People

Contributors

allcontributors[bot] avatar codacy-badger avatar dannyfeliz avatar dreambo8563 avatar fossabot avatar greenkeeper[bot] avatar mubaidr 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

easy-circular-progress's Issues

Doesn't accept Integer value.

Hello, I really commend the great work done on this library.

I tried using in one of my projects but I'm having issue with passing integer value. I get a Maximum call stack size exceeded error.

Please what can be done to resolve this issue?

Thank you.

Disable dot in progress value

Hi there, was wondering if we can disable the dot value in the progress-circle itself.

Do let me know if it's applicable, as I only want to achieve a value without a decimal

Thanks!
Fitri

0 value doesnt change circle ui

Hi, i have some issue went i've data 0, i've data 0 and non 0 value, when i am fill value with non zero value circle ui will be change but unfotunately when i am use 0 data circle ui doesnt changes to 0.

An in-range update of core-js is breaking the build 🚨

The dependency core-js was updated from 3.4.6 to 3.4.7.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

core-js is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details

Release Notes for 3.4.7 - 2019.12.03
  • Fixed an NPM publishing issue
FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

move core-js to devDepenencies

Hi @dreambo8563 , seems core-js is used in dev mode, add to depDependence will result unintentinal install, which will lead our parent project build problems.

Please move core-js to devDependencies. Thanks.

is there any option about change values

hi guys

I've got an error about that
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "value"

how to update component's value of progress

i just change directly like "this.$refs.progress.value = result.value"

i can't use eventBus&$emit.
cuz i can't access the component directly.

need a helps. thank you

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.