How to use hanzi-writer - 1 common examples

To help you get started, we’ve selected a few hanzi-writer 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 chanind / hanzi-writer-miniprogram / src / hanzi-writer-context.js View on Github external
showHintAfterMisses,
    highlightOnComplete,
    highlightCompleteColor,
  }) {
    if (!id || !page) {
      throw new Error('parameter id, page are required');
    }

    this.comp = page.selectComponent('#' + id);
    if (!this.comp) {
      throw new Error(`hanzi-writer-view with id ${id} not found`);
    }

    this.isDestroyed = false;

    this.writer = new HanziWriter(this.comp, removeEmptyKeys({
      width: this.comp.data.width,
      height: this.comp.data.height,
      charDataLoader: charDataLoader || defaultCharDataLoader,
      onLoadCharDataError,
      onLoadCharDataSuccess,
      showOutline,
      showCharacter,
      padding,
      strokeAnimationSpeed,
      strokeFadeDuration,
      strokeHighlightDuration,
      strokeHighlightSpeed,
      delayBetweenStrokes,
      delayBetweenLoops,
      strokeColor,
      radicalColor,

hanzi-writer

Hanzi Writer is a free and open-source javascript library for both animating simplified Chinese characters and quizzing users on character stroke order.

MIT
Latest version published 1 month ago

Package Health Score

75 / 100
Full package analysis

Popular hanzi-writer functions