{"id":16505508,"url":"https://github.com/davidbrochart/yjs-widgets","last_synced_at":"2025-03-23T13:32:09.350Z","repository":{"id":161054428,"uuid":"621334934","full_name":"davidbrochart/yjs-widgets","owner":"davidbrochart","description":"a JupyterLab extension for widgets based on Yjs","archived":false,"fork":false,"pushed_at":"2024-08-27T16:49:28.000Z","size":249,"stargazers_count":4,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-08-27T18:33:48.500Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidbrochart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-30T13:08:01.000Z","updated_at":"2024-08-27T16:49:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"e7d9ffa3-6670-4bc8-8474-2c342668f450","html_url":"https://github.com/davidbrochart/yjs-widgets","commit_stats":{"total_commits":15,"total_committers":3,"mean_commits":5.0,"dds":"0.19999999999999996","last_synced_commit":"6530c0c837940dfd251509720e0daaa2fb880b5b"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidbrochart%2Fyjs-widgets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidbrochart%2Fyjs-widgets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidbrochart%2Fyjs-widgets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidbrochart%2Fyjs-widgets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidbrochart","download_url":"https://codeload.github.com/davidbrochart/yjs-widgets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219860298,"owners_count":16556019,"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","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":[],"created_at":"2024-10-11T15:12:07.522Z","updated_at":"2024-10-11T15:13:41.933Z","avatar_url":"https://github.com/davidbrochart.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JupyterLab extension for widgets based on Yjs\n\n## Requirements\n\n- JupyterLab == 4.0.0b0\n\n## Installation\n\nYou can install yjs-widgets using pip:\n\n```bash\npip install yjs-widgets\n```\n\n## Usage\n\n```typescript\nimport { IJupyterYModel } from './types';\nimport { JupyterYModel } from './model';\nimport { IJupyterYWidgetManager } from './notebookrenderer/types';\nimport {\n  JupyterFrontEnd,\n  JupyterFrontEndPlugin\n} from '@jupyterlab/application';\n\nclass MyWidget {\n  constructor(yModel: IJupyterYModel, node: HTMLElement) {\n    this.yModel = yModel;\n    this.node = node;\n    yModel.sharedModel.attrsChanged.connect(() =\u003e {\n      this._attrsChanged();\n    });\n    node.textContent = 'Hello world!';\n  }\n\n  _attrsChanged(): void {\n    const foo: string = this.yModel.sharedModel.getAttr('foo') as string;\n    const bar: string = this.yModel.sharedModel.getAttr('bar') as string;\n    this.node.textContent = `foo=${foo}, bar=${bar}`;\n  }\n\n  yModel: IJupyterYModel;\n  node: HTMLElement;\n}\n\nexport const foo: JupyterFrontEndPlugin\u003cvoid\u003e = {\n  id: 'foo:bar',\n  autoStart: true,\n  requires: [IJupyterYWidgetManager],\n  activate: (app: JupyterFrontEnd, wm: IJupyterYWidgetManager): void =\u003e {\n    wm.registerWidget('MyWidget', JupyterYModel, MyWidget);\n  }\n};\n```\n\n## Contributing\n\nyjs-widgets is an open-source project, and contributions are always welcome. If you would like to contribute, please fork the repository and submit a pull request.\n\nSee [CONTRIBUTING](CONTRIBUTING.md) for dev installation instructions.\n\n## License\n\nyjs-widgets is licensed under the BSD 3-Clause License. See the LICENSE file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidbrochart%2Fyjs-widgets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidbrochart%2Fyjs-widgets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidbrochart%2Fyjs-widgets/lists"}