How to use the spritejs.use function in spritejs

To help you get started, we’ve selected a few spritejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spritejs / sprite-workflow / src / index.js View on Github external
import { install } from 'sprite-extend-shapes'
import { Base } from './base'
import { Step } from './step'
import { Link } from './link'
import * as spritejs from 'spritejs'
import { _steps, _links, _workflow, _render, _isDragging, _hasLinkReject } from './symbolNames'
import * as functions from './functions'
import { getType } from './utils'
import { Ticks } from './ticks'

const { Scene } = spritejs;
spritejs.use(install);
class Workflow extends Base {
  constructor(attrs) {
    super(attrs);
    /*****
  * selector:css选择器
  * size:canvas倧小
  * zoom:ζ˜―ηΌ©ζ”Ύ
  * **/
    this.ticks = new Ticks(); // θ‡ͺθΊ«ηš„ticks函数倄理
    this.attr(Object.assign({
      'selector': '',
      'size': [ 600, 400 ],
      'zoom': [ 0.5, 2 ]
    }, attrs));
    const { selector, size } = this.attr();
    const scene = new Scene(selector, {
github spritejs / q-charts / src / index.js View on Github external
import * as spritejs from 'spritejs'
import shapes from '@spritejs/shapes'
import { getGlobal } from './util'
import * as core from './core'
import * as visuals from './visuals'
import * as plugins from './plugins'
import * as Theme from './themes'

spritejs.use(shapes)

core.Global.registerTheme('default', Theme.light)
core.Global.registerTheme('dark', Theme.dark)

const version = require('../package.json').version

export const qcharts = {
  version,
  ...core,
  ...visuals,
  ...plugins
}

const global = getGlobal()
global.qcharts = qcharts