{"id":37904227,"url":"https://github.com/loadingio/ldresize","last_synced_at":"2026-01-16T17:08:09.819Z","repository":{"id":42209008,"uuid":"184518429","full_name":"loadingio/ldresize","owner":"loadingio","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-01T14:53:30.000Z","size":1445,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T11:13:37.241Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"LiveScript","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/loadingio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-05-02T04:01:19.000Z","updated_at":"2025-04-01T14:53:34.000Z","dependencies_parsed_at":"2025-04-01T16:25:32.259Z","dependency_job_id":"169b07db-f027-43be-a08f-e7531431db81","html_url":"https://github.com/loadingio/ldresize","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/loadingio/ldresize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Fldresize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Fldresize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Fldresize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Fldresize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loadingio","download_url":"https://codeload.github.com/loadingio/ldresize/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadingio%2Fldresize/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-16T17:08:09.151Z","updated_at":"2026-01-16T17:08:09.811Z","avatar_url":"https://github.com/loadingio.png","language":"LiveScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ldresize\n\nA simple bounding box widget empowering users with the ability to move, rotate or scale anything.\n\n\n## Usage\n\n    # create a new ldr instance.\n    ldr = new ldresize ...\n\n    # attach to certain node.\n    ldr.attach node\n\n    ldr.on \\resize, -\u003e ...\n    state = ldr.get!\n\n    ldr.detach!\n\n\n## Configuration\n\nconfigs are set in a object which is passed into the ldresize constructor. For example:\n\n    new ldresize({root: \".root\"});\n\n\n## Configuration\n\n * `host` - CSS selector or element where to put resize widget elements. will use `root` if `host` is omitted.\n * `root` - CSS selector or element for the container of the elements to be resized.\n   ldresize automatically intercept mouse events for elements in `root` and handle the interactions.\n * `filter(n)` - callback function to determine if an element `n` should be resized.\n   ldresize by default resizes all elements if filter is omitted.\n   called on mousedown on root element.\n * `mousedown` - TBD\n * `visible-ctrl-r` - default false. show all rotating ctrl node if true.\n\n\n## API\n\n * `attach(n,append)`: attach resizer to certain node(s) and show resize widget.\n   - `n`: node(s) to be attached. can be a list or a single node. equivalent to detech if n = null.\n   - `append`: default false. append n to current attached list if true.\n * `detect()`: clear attached list and hide resize widget.\n * `render()`: update transformation of resize widget and attached nodes.\n * `pts`: internal api ( TBD )\n * `box-offset`: internal api ( TBD )\n * `get()`: return an object representing transformation information as follow:\n   - `t`: {x, y} - translate\n   - `s`: {x, y} - scale\n   - `r`: rotate\n   - `x, y, w, h`: Bounding Rect. ( TBD? )\n   - `box`: TBD\n * `on(name, cb)`: handle specific event `name` with function `cb`.\n\n### API ( WIP )\n * `set({t`: {x, y}, s: {x, y}, r}, delta): set affine transformation for attached node. ( No Yet Implemented )\n   if delta is true, all values in params are relative to current values.\n\n\n## Events\n\n * `resize`: fire when resizing ( including translating, rotating and scaling ). arguments:\n   - `dim`: transformation information. see `get` API for more information.\n   - `targets`: list of affected nods\n\n\n## Widget Hierarchy\n\nldresize will add a set of SVG elements for controlling the resize of any elements. This reizer widget is constructed with following structure:\n\n * g\n   - path.ldr-ctrl.bbox\n   - rect.ldr-ctrl.r x 4\n   - rect.ldr-ctrl.s x 9\n\n\n## CSS Classes Used\n\n * `ldr-host` - host element\n   - `ldr-host-standalone` - added on host element if root != host\n * `ldr-ctrl` - control points\n   - `r` - ctrl points for rotating\n   - `s` - ctrl points for resizing\n   - `bbox` - wireframe of the resize rectangle\n\n\n## Technical Note\n\n * Additional interface:\n   * `node._lasttransform` - old transform attribute will be stored in this attribute of specific node when ldresize is going to overwrite it.\n     - currently, this is only done when _lasttransform is undefined.\n     - TODO: add opt for customize attr name and store timing?\n * ldresize store transformation matrix for both parent and node in `_mo` and `_mi` member of an element. Also, old transform info is stored in `_lasttransform`. This is somewhat hacky, maybe we can find a better way to replace these in the future.\n\n\n## Todo\n\n * Supporting non-preserving-aspect-ratio scaling in group resizing, which needs to deal with shearing.\n   - Illustrator just expand the transform into shape. Perhaps it's an feasible approach.\n * should we provide API for customizing before ldresize applying transformation over attached nodes?\n * Support HTML\n   - currently we use features from SVG, such as SVGMatrix, node.transform.baseVal, etc so we don't support HTML.\n * make `root` optional ( is this necessary? )\n * resizing might lead to distortion. try to support resizing that is actually updating position of the underlying points, or only the input box ( e.g., for text box resizing )\n\nExpected Features:\n\n * Vanilla JS\n * works both for SVG or HTML ( SVG: ready, HTML: wip )\n   - auto parse transform attr/style for extracting current t/r/s.\n   - keep the flexibility of working also on Canvas. ( Todo )\n * incudes basic affine transformation\n   - can support shear, skew in SVG ? ( Todo )\n * auto transform target, but could also be set to manual\n   - then user should do it themselves from values of get-state.\n\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floadingio%2Fldresize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floadingio%2Fldresize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floadingio%2Fldresize/lists"}