angular2-round-sliding-dial
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

angular2-round-sliding-dial

Installation

To install this component, run:

$ npm install angular2-round-sliding-dial --save

Using Smartenit Module

Include RoundSliderComponent in your Angular 2 main module:

// ...
import { RoundSliderComponent } from 'angular2-round-sliding-dial/dist';
 
@NgModule({
  // ...
  declarations: [
    // ...
    RoundSliderComponent
  ]
})
export class AppModule { }

Usage

<round-slider #sliderElem 
    [width]="140" 
    [height]="140" 
    [radius]="50"
    [value]="levelControlValue"
    (onChange)="listenerEvent$.next(sliderElem.value)"
    (onChangeEnd)="listenerEvent$.next(sliderElem.value)"
    [image]="'https://s-media-cache-ak0.pinimg.com/736x/99/9b/af/999baff3288ebe0232ac9d34ac7b73ba.jpg'"
></round-slider>
 

Styling

Please make sure to include and customize the component scss in your angular project

round-slider {
  display: block;
 
  .round-slider-container {
    position: relative;
  }
 
  .container {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 20;
  }
 
  .round-slider-image {
    background-size: cover;
    border-radius: 50%;
    position: absolute;
  }
 
  .round-slider-text {
    text-align: center;
    position: absolute;
    width: 100%;
    display: table-cell;
    vertical-align: middle;
    top: 41%;
    pointer-events: none;
    z-index: 10;
    color: white;
    font-size: 18px;
  }
 
  .circumference {
    &.transparent {
      fill: transparent;
    }
    fill: #f2f2f2;
  }
 
  .dot circle:hover {
    cursor: pointer;
  }
 
  .dot circle {
    fill: lightsteelblue;
    stroke: lightsteelblue;
    stroke-width: 1.5px;
  }
 
  .dot circle.dragging {
    fill: steelblue;
    stroke: steelblue;
  }
 
  .arc {
    fill: steelblue;
  }
}

License

MIT

Package Sidebar

Install

npm i angular2-round-sliding-dial

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • ammaar23