{"id":20873785,"url":"https://github.com/dbtek/hyperc","last_synced_at":"2025-08-04T08:33:37.708Z","repository":{"id":38310893,"uuid":"111570509","full_name":"dbtek/hyperc","owner":"dbtek","description":"State driven high performance canvas graphics framework based on EaselJS and JSON Patch.","archived":false,"fork":false,"pushed_at":"2025-05-12T07:54:04.000Z","size":583,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-15T16:46:12.717Z","etag":null,"topics":["canvas","easeljs","graphics","json-patch","state"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbtek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-21T15:58:47.000Z","updated_at":"2025-05-12T07:54:00.000Z","dependencies_parsed_at":"2023-01-25T19:31:27.462Z","dependency_job_id":null,"html_url":"https://github.com/dbtek/hyperc","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/dbtek/hyperc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbtek%2Fhyperc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbtek%2Fhyperc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbtek%2Fhyperc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbtek%2Fhyperc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbtek","download_url":"https://codeload.github.com/dbtek/hyperc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbtek%2Fhyperc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268669550,"owners_count":24287782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["canvas","easeljs","graphics","json-patch","state"],"created_at":"2024-11-18T06:27:21.697Z","updated_at":"2025-08-04T08:33:37.656Z","avatar_url":"https://github.com/dbtek.png","language":"JavaScript","readme":"hyperc\n===\n\n[![Build Status](https://img.shields.io/circleci/project/github/dbtek/hyperc.svg?style=flat-square) ](https://circleci.com/gh/dbtek/hyperc)  [ ![Test Coverage](https://img.shields.io/codecov/c/token/bDcjOrSeM2/github/dbtek/hyperc/master.svg?style=flat-square) ](https://codecov.io/github/dbtek/hyperc)  [ ![Standard](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://codecov.io/github/dbtek/hyperc)\n\n\nState driven high performance canvas graphics framework based on [EaselJS](https://createjs.com/easeljs) and [JSON Patch](https://github.com/angus-c/just).\n\nCurrently, hyperc is in alpha stage, things may change.\n\nHighly inspired from [choojs/choo](https://github.com/choojs/choo).\n\n### Example\n\n```html\n...\n  \u003ccanvas id=\"stage\" width=\"600\" height=\"600\"\u003e\u003c/canvas\u003e\n...\n```\n```js\nconst Hyperc = require('hyperc')\nconst Component = require('hyperc/component')\nconst consecutive = require('consecutive')\n\nvar app = new Hyperc('#stage')\n\nfunction circleStore (state, emitter) {\n  state.circles = [\n    {id: 1, x: 100, y: 100, radius: 100, color: 'DeepSkyBlue'}\n  ]\n  // set next id 2\n  var nextId = consecutive(2)\n\n  emitter.on('circle:add', item =\u003e {\n    const id = nextId()\n    state.circles.push(Object.assign({}, item, {id}))\n    emitter.emit('render')\n  })\n\n  emitter.on('circle:moveItem', ({id, x, y}) =\u003e {\n    var circle = state.circles.filter(c =\u003e c.id === id)[0]\n    if (!circle) return\n    circle.x = x\n    circle.y = y\n    emitter.emit('render')\n  })\n}\n\nclass Circle extends Component {\n  static getItems (state) {\n    return state.circles\n  }\n\n  identity (props) {\n    return props.id\n  }\n\n  create (props) {\n    var shape = new createjs.Shape()\n    shape.graphics.beginFill(props.color).drawCircle(0, 0, props.radius).endFill()\n    shape.x = props.x\n    shape.y = props.y\n    this.shape = shape\n    // add newly created shape to component's container\n    this.container.addChild(shape)\n    shape.on('pressmove', e =\u003e {\n      this.emit('circle:moveItem', {\n        id: this.id,\n        x: e.stageX,\n        y: e.stageY\n      })\n    })\n  }\n\n  update (props, patch) {\n    this.shape.x = props.x\n    this.shape.y = props.y\n    this.shape.graphics.clear().beginFill(props.color).drawCircle(0, 0, props.radius).endFill()\n  }\n}\n\n// add store\napp.use(circleStore)\n\n// add renderer\napp.render(Circle)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbtek%2Fhyperc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbtek%2Fhyperc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbtek%2Fhyperc/lists"}