{"id":25167143,"url":"https://github.com/biocomputingup/feature-viewer-typescript-mobidb","last_synced_at":"2025-04-03T17:44:13.134Z","repository":{"id":57234210,"uuid":"408834467","full_name":"BioComputingUP/feature-viewer-typescript-mobidb","owner":"BioComputingUP","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-02T11:10:28.000Z","size":203,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-02T03:35:03.354Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BioComputingUP.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":"2021-09-21T13:37:42.000Z","updated_at":"2021-12-02T11:10:30.000Z","dependencies_parsed_at":"2022-09-05T21:11:08.945Z","dependency_job_id":null,"html_url":"https://github.com/BioComputingUP/feature-viewer-typescript-mobidb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioComputingUP%2Ffeature-viewer-typescript-mobidb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioComputingUP%2Ffeature-viewer-typescript-mobidb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioComputingUP%2Ffeature-viewer-typescript-mobidb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioComputingUP%2Ffeature-viewer-typescript-mobidb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BioComputingUP","download_url":"https://codeload.github.com/BioComputingUP/feature-viewer-typescript-mobidb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247051984,"owners_count":20875677,"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":"2025-02-09T06:19:42.161Z","updated_at":"2025-04-03T17:44:13.113Z","avatar_url":"https://github.com/BioComputingUP.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeScript Feature Viewer\n\nThis is a code repository for the BioComputingUP Feature Viewer project.\nFull documentation at: http://protein.bio.unipd.it/feature-viewer.\n\nThis project is based on the Javascript version [calipho-sib/feature-viewer](https://github.com/calipho-sib/feature-viewer), \nCopyright (c) 2015, SIB Swiss Institute of Bioinformatics. This version is based on [Typescript](https://www.typescriptlang.org/) \nand compatible with [Angular 2+](https://angular.io/) framework.\n\nRepresent biological data with the feature viewer library! Used in [MobiDB](http://mobidb.bio.unipd.it/), \n[DisProt](http://www.disprot.org/), [RepeatsDB](http://repeatsdb.bio.unipd.it/) and \n[PhytotypeDB](http://phytotypedb.bio.unipd.it/).\n\n## Dependencies\n\n* [Typescript](https://www.typescriptlang.org/) \n* [D3](https://d3js.org/)\n* [html-to-image](https://www.npmjs.com/package/html-to-image)\n\n## Getting started\n\n1 Install the library using npm\n```\nnpm install feature-viewer-typescript\n```\n\n2 Import the feature viewer in javascript or your angular component\n```typescript\nimport {FeatureViewer} from 'feature-viewer-typescript/lib';\n```\n\n3 Optional: if you are installing the feature viewer in an Angular 2+ based App, you may \nneed to load the feature viewer stylesheet in your angular.json \"styles\" to \nensure the correct pioritization of stylesheets.\n```json\nstyles: [\n    \"./node_modules/feature-viewer-typescript/assets/fv.scss\"\n]\n```\n\n4 Place the feature viewer in your html\n```html\n\u003cdiv id=\"myfv\"\u003e\u003c/div\u003e\n```\n\n5 Create an instance of the feature viewer in javascript and style it\n```typescript\nconst proteinsequence = 'MTKFTILLISLLFCIAHTCSASKWQHQQDSCRKQLQGVNLTPCEKHIMEKIQGRGDDDDDDDDDNHILRTMRGRINYIRRNEGKDEDEE'\nconst fv = new FeatureViewer(proteinsequence, '#myfv', {\n               showAxis: true,\n               showSequence: true,\n               toolbar: true,\n               toolbarPosition: 'left',\n               zoomMax: 10,\n               flagColor: '#DFD5F5'\n           });\n```\n\n6 Add features and subfeatures\n```typescript\nfv.addFeatures(\n      [\n        { // simple rect\n          type: 'rect',\n          id: 'useUniqueId',\n          data: [ {\n            x: 50, y: 78,\n            tooltip: '\u003cbutton class=\"myButton\"\u003eButton\u003c/button\u003e'} ],\n        },\n        { // circles\n          type: 'circle',\n          id: 'mycircle',\n          label: 'Circle feature',\n          data: [{x: 10 , y: 100}, {x: 50, y: 70}, {x: 40, y: 60, color: '#00ac8f', tooltip: 'I have different color'}],\n          color: '#61795e'\n        },\n        { // curve (height and yLim) with tooltip and subfeatures\n          type: 'curve',\n          id: 'mycurve',\n          label: 'Curve label',\n          data: [{x: 1, y: 0}, {x: 40, y: 102}, {x: 80, y: 5}, {x: 50, y: 184}, {x: 75, y: 4}],\n          height: 1,\n          yLim: 200,\n          color: '#00babd',\n          tooltip: '\u003cb\u003eVery\u003c/b\u003e \u003cspan style=\"color: #C21F39\"\u003eStylable\u003c/span\u003e \u003cb\u003e\u003ci\u003e\u003cspan style=\"color: #ffc520\"\u003eTooltip \u003c/span\u003e\u003c/i\u003e\u003c/b\u003e',\n          subfeatures: [\n            {\n              type: 'rect',\n              data: [\n                {x: 20, y: 30},\n                {x: 15, y: 45},\n                {x: 70, y: 76, label: 'myRect', tooltip: 'myTooltip'}\n              ],\n              id: 'aDifferentId',\n              label: 'I am a subfeature!'\n            }\n          ]\n        }\n      ]\n    )\n```\n\n7 Output\n\n![Feature Viewer](assets/fvDemo.png)\n\n## Support\n\nIf you have any problem or suggestion please open an issue.\n\n## Developers\n\nTo build: npm install \u0026\u0026 tsc.\n\nTo test locally: follow the \"Getting started\" section, but instead of installing the package through npm, download the feature-viewer-typescript-mobidb project from github. Create an angular project and in node modules add a symlink to the feature-viewer-typescript-mobidb folder (ln -s ../../local-folder feature-viewer-typescript). Keep following the instruction from point 2 \"Import the feature viewer\".\n\n\n## License\n\nThis repo is based on [calipho-sib/feature-viewer](https://github.com/calipho-sib/feature-viewer), Copyright (c) 2015, SIB Swiss \nInstitute of Bioinformatics.\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public \nLicense as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later \nversion.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiocomputingup%2Ffeature-viewer-typescript-mobidb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiocomputingup%2Ffeature-viewer-typescript-mobidb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiocomputingup%2Ffeature-viewer-typescript-mobidb/lists"}