{"id":15405858,"url":"https://github.com/elia/hyper-vis","last_synced_at":"2026-02-21T19:30:18.130Z","repository":{"id":66505049,"uuid":"126083365","full_name":"elia/hyper-vis","owner":"elia","description":"A Opal Ruby wraper for Vis.js with a Ruby-Hyperloop Component.","archived":false,"fork":false,"pushed_at":"2018-03-21T01:49:27.000Z","size":486,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-28T03:52:20.843Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"janbiedermann/hyper-vis","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elia.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-20T21:15:12.000Z","updated_at":"2023-10-09T04:43:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"b54a061e-5fbe-4bb3-897a-92bfa8753692","html_url":"https://github.com/elia/hyper-vis","commit_stats":{"total_commits":45,"total_committers":2,"mean_commits":22.5,"dds":0.0444444444444444,"last_synced_commit":"ebfac09c6c3db9eb697bbbe4359cccffe61a907f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elia%2Fhyper-vis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elia%2Fhyper-vis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elia%2Fhyper-vis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elia%2Fhyper-vis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elia","download_url":"https://codeload.github.com/elia/hyper-vis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239850898,"owners_count":19707426,"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-01T16:18:46.783Z","updated_at":"2026-02-21T19:30:18.059Z","avatar_url":"https://github.com/elia.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hyper-vis\n\nA Opal Ruby wraper for [Vis.js](http://visjs.org) with a Ruby-Hyperloop Component.\nCurrently supports the complete API for:\n- Vis Dataset\n- Vis Dataview\n- Vis Network\n\n### Demo\n\n[![Reactivity Demo](http://img.youtube.com/vi/fPSpESBbeMQ/0.jpg)](http://www.youtube.com/watch?v=fPSpESBbeMQ \"Reactivity Demo\")\n\n### Installation\nfor a rails app:\n```\ngem 'hyper-vis'\n```\nand `bundle update`\nhyper-vis depends on `hyper-component` from [Ruby-Hyperloop](http://ruby-hyperloop.org)\n\nvis.js is automatically imported. If you use webpacker, you may need to cancel the import in your config/intializers/hyperloop.rb\n```\n  config.cancel_import 'vis/source/vis.js'\n```\nThe wrapper expects a global `vis' (not `Vis`) to be availabe in javascript. \nstylesheets are includes in 'vis/source/vis.css', images are there too.\n\n### Usage\n\n#### The Vis part\n```\ndataset = Vis::DataSet.new([{id: 1, name: 'foo'}, {id: 2, name: 'bar'}, {id: 3, name: 'pub'}])\nedge_dataset = Vis::DataSet.new([{from: 1, to: 2}, {from: 2, to: 3}])\ndom_node = Vis::Network.test_container\nnet = Vis::Network.new(dom_node, {nodes: dataset, edges: edge_dataset})\nxy = net.canvas_to_dom({x: 10, y: 10})\n```\n#### The Component part\nThe Component takes care about all the things necessary to make Vis.js play nice with React.\nThe Component also provides a helper to access the document.\nVis::Network can be used within the render_with_dom_node.\n```\nclass MyVisNetworkComponent\n  include Hyperloop::Vis::Network::Mixin\n\n  automatic_refresh true # thats the default, may set to false\n\n  render_with_dom_node do |dom_node, data, options|\n\n    net = Vis::Network.new(dom_node, data, options)\n\n    canvas = document.JS.querySelector('canvas')\n  end\nend\n\nclass AOuterComponent \u003c Hyperloop::Component\n  render do\n    received_data = []\n\n    options = { manipulation: {\n        edit_node: proc { |node_data, callback| received_data \u003c\u003c node_data }\n      }}\n\n    data = Vis::DataSet.new([{id: 1, name: 'foo'}, {id: 2, name: 'bar'}, {id: 3, name: 'pub'}])\n    \n    DIV { MyVisNetworkComponent(vis_data: data, otions: options)}\n  end\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felia%2Fhyper-vis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felia%2Fhyper-vis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felia%2Fhyper-vis/lists"}