{"id":13576211,"url":"https://github.com/bookingcom/powercalculator","last_synced_at":"2025-04-27T19:33:08.238Z","repository":{"id":40856848,"uuid":"111392820","full_name":"bookingcom/powercalculator","owner":"bookingcom","description":"Calculator to define runtime of experiments","archived":false,"fork":false,"pushed_at":"2023-06-14T12:52:39.000Z","size":3185,"stargazers_count":88,"open_issues_count":20,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-05T03:02:04.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://bookingcom.github.io/powercalculator/","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/bookingcom.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":"2017-11-20T10:02:21.000Z","updated_at":"2025-01-14T04:10:40.000Z","dependencies_parsed_at":"2024-11-05T12:31:34.516Z","dependency_job_id":"5eed2bda-3a3c-4b9b-b776-1dfaf2759f75","html_url":"https://github.com/bookingcom/powercalculator","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bookingcom%2Fpowercalculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bookingcom%2Fpowercalculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bookingcom%2Fpowercalculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bookingcom%2Fpowercalculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bookingcom","download_url":"https://codeload.github.com/bookingcom/powercalculator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251196448,"owners_count":21550953,"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-08-01T15:01:08.022Z","updated_at":"2025-04-27T19:33:07.685Z","avatar_url":"https://github.com/bookingcom.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Power Calculator\nThis is a Vuejs component to help decide how long you should run your experiment.\n\n# External Dependencies\nCurrently the graph works with D3 and C3. You will have to add those libraries to your project in case you want the graph.\n\n# Getting Started\n## Instalation\nThen you can run `$ yarn install`.\n\nWhen you want to build the component you will use `$ yarn build`.\n\nWhen you want to develop, rollup has a watch flag, use `$ yarn watch`.\n\nYou can change rollup.config.js if the current setup doesn't suit your needs.\n\nWe are creating a js and css output files. You need to add both to your project.\n\n## How to use:\nAfter running rollup, you will have a vuejs component you can add to your vuejs application.\n\nSimple example would be:\n```js\nlet { powerCalculator, store } = require('powercalculator');\n\nconst storeInstance = new Vuex.Store(store)\n\nnew Vue(Object.assign({\n    store: storeInstance,\n    el: '.power-calculator',\n}, powerCalculator));\n```\n\nPlease note that the module will actually have 2 different properties:\n - component\n - store\n\nIn the example above we are just using the component to create a vue instance. It could be used with `Vue.component` as well.\n\nYou can create the instance of vuex with the store, merge it with yours.\n\n### Updating store from start\nWhile we do have an action for testing to easily manipulate the store ('test:reset'), I'd recommend manipulating the store object before creating the vuex instance or creating your own actions.\n\n### Listening to store changes\nI'd recommend using [Vuex Plugins](https://vuex.vuejs.org/en/plugins.html) for this.\n\n## Some of the important actions of powercalculator store\n| action | description |\n| ------------- | ------------- |\n| init:calculator | Called when the component is mounted. starts calculations and deal with needed logic |\n| field:change | Most important action. Dispatched whenever an input field change. This is the root of all the logic behind most of the mutations will happen. |\n| update:proptocalculate | Triggers the calculation of the highlighted block |\n\n# Dev Server\nYou can run `$ yarn serve` to run a development server which points to\n`localhost:5000`. It will load the `index.html` file which points to the files\nin the `dist` folder. You will need to run `$ yarn watch` in a different process \nto develop.\n\n# Tests\nDue to the complexity of the tool we have a few different options of testing.\n\n - `yarn test`: Run all tests - test the mathematical functions, runs eslint and test the store updates\n - `yarn vue-check`: runs eslint and test the store updates (we are unlikely to change the mathematical functions as often as the rest)\n - `yarn store`: test the store updates\n - `yarn eslint`: runs eslint\n\n# COPYRIGHT AND LICENSE\n\nThis is free software, licensed under:\n\nThe MIT (X11) License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbookingcom%2Fpowercalculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbookingcom%2Fpowercalculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbookingcom%2Fpowercalculator/lists"}