{"_id":"fusioncharts-smartlabel","_rev":"31-8c4e840ef4bbe573d43a395c92e5d5c7","name":"fusioncharts-smartlabel","description":"SmartLabel component to measure and restrict text in svg / canvas","dist-tags":{"latest":"2.1.2"},"versions":{"1.0.1":{"name":"fusioncharts-smartlabel","version":"1.0.1","keywords":["smartlabel","fusioncharts","text","svg","canvas"],"author":{"name":"FusionCharts Technologies  &lt;support@fusioncharts.com&gt;"},"license":"MIT","_id":"fusioncharts-smartlabel@1.0.1","maintainers":[{"name":"fusioncharts","email":"mail@labs.fusioncharts.com"}],"contributors":[{"name":"Akash Goswami"},{"name":"Rohit Kumar"},{"name":"Shamasis Bhattacharya"},{"name":"Subhash Haldar"}],"homepage":"https://github.com/fusioncharts/fusioncharts-smartlabel","bugs":{"url":"https://github.com/fusioncharts/fusioncharts-smartlabel/issues"},"dist":{"shasum":"216925d002b3fd47b41901687424b513d28fd04b","tarball":"https://registry.npmjs.org/fusioncharts-smartlabel/-/fusioncharts-smartlabel-1.0.1.tgz","integrity":"sha512-Wv9P2ldEYiNuo9tN0QhxUbBDAzg7G27fwXNjkcpcDKFkI8C+3yMIyC0zYKqrFezfL+E+Q9nH542J953/6Osr8w==","signatures":[{"sig":"MEUCICzQunsYDztDCR0j0vOlHMRGGB4oTM/jNpHcoCYgtvBTAiEAtkOlg6vdfHEpsEOn7xZi+q648+3jFxOu/IkhBMhACZc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/smartlabel-manager.js","_from":".","_shasum":"216925d002b3fd47b41901687424b513d28fd04b","gitHead":"2784be429123cbeb10ff8fc00e27bab33577d3af","scripts":{"lint":"eslint ./; true","test":"script/test","build":"gulp clean && NODE_ENV=production gulp build","start":"gulp dev","coveralls":"cat coverage/report-lcov/lcov.info | node node_modules/.bin/coveralls"},"_npmUser":{"name":"fusioncharts","email":"mail@labs.fusioncharts.com"},"repository":{"url":"git+https://github.com/fusioncharts/fusioncharts-smartlabel.git","type":"git"},"_npmVersion":"3.10.9","description":"SmartLabel component to measure and restrict text in svg / canvas","directories":{},"_nodeVersion":"6.9.2","browserify-shim":{"react":"global:React"},"devDependencies":{"d3":"^4.4.0","chai":"^3.5.0","gulp":"^3.9.0","karma":"^1.3.0","mocha":"^3.2.0","react":"^0.14.0","eslint":"^1.6.0","coveralls":"^2.11.15","react-dom":"^0.14.0","karma-chai":"^0.1.0","karma-mocha":"^1.3.0","babel-eslint":"^4.1.3","karma-coverage":"^1.1.1","eslint-plugin-react":"^3.5.1","karma-spec-reporter":"0.0.26","karma-phantomjs-launcher":"^1.0.2","react-component-gulp-tasks":"^0.7.6"},"_npmOperationalInternal":{"tmp":"tmp/fusioncharts-smartlabel-1.0.1.tgz_1483353191437_0.43398588919080794","host":"packages-18-east.internal.npmjs.com"}},"1.0.2":{"name":"fusioncharts-smartlabel","version":"1.0.2","keywords":["smartlabel","fusioncharts","text","svg","canvas"],"author":{"name":"FusionCharts Technologies  &lt;support@fusioncharts.com&gt;"},"license":"MIT","_id":"fusioncharts-smartlabel@1.0.2","maintainers":[{"name":"fusioncharts","email":"mail@labs.fusioncharts.com"}],"contributors":[{"name":"Akash Goswami"},{"name":"Rohit Kumar"},{"name":"Shamasis Bhattacharya"},{"name":"Subhash Haldar"}],"homepage":"https://github.com/fusioncharts/fusioncharts-smartlabel","bugs":{"url":"https://github.com/fusioncharts/fusioncharts-smartlabel/issues"},"dist":{"shasum":"84ebcb6c6f0ccc7f8e812a9f19b79313d83ed631","tarball":"https://registry.npmjs.org/fusioncharts-smartlabel/-/fusioncharts-smartlabel-1.0.2.tgz","integrity":"sha512-dLTD5ClBq/1bzC7aPhaT4dg8Hoc4ATF8NKf0WHRYW5KVJ42M38kYOq+SU7fzZ6BgHJicPXH6I/VWX3WbdIXaaA==","signatures":[{"sig":"MEYCIQCc6ebtdXW14wIjO9ccq2ZxLNMXdhxnLNLTraCL1nhNCwIhAM6ClgHsVFOWf+nJQP72dGNq8AQTh/mssdoMLiVUf67z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/SmartlabelManager.js","_from":".","_shasum":"84ebcb6c6f0ccc7f8e812a9f19b79313d83ed631","gitHead":"9f649bc1c0da0315f45798b752f1e56fb59a1d57","scripts":{"lint":"eslint ./; true","test":"script/test","build":"gulp clean && NODE_ENV=production gulp build","start":"gulp dev","coveralls":"cat coverage/report-lcov/lcov.info | node node_modules/.bin/coveralls"},"_npmUser":{"name":"fusioncharts","email":"mail@labs.fusioncharts.com"},"repository":{"url":"git+https://github.com/fusioncharts/fusioncharts-smartlabel.git","type":"git"},"_npmVersion":"3.10.9","description":"SmartLabel component to measure and restrict text in svg / canvas","directories":{},"_nodeVersion":"6.9.2","browserify-shim":{"react":"global:React"},"devDependencies":{"d3":"^4.4.0","chai":"^3.5.0","gulp":"^3.9.0","karma":"^1.3.0","mocha":"^3.2.0","react":"^0.14.0","eslint":"^1.6.0","coveralls":"^2.11.15","react-dom":"^0.14.0","karma-chai":"^0.1.0","karma-mocha":"^1.3.0","babel-eslint":"^4.1.3","karma-coverage":"^1.1.1","eslint-plugin-react":"^3.5.1","karma-spec-reporter":"0.0.26","karma-phantomjs-launcher":"^1.0.2","react-component-gulp-tasks":"^0.7.6"},"_npmOperationalInternal":{"tmp":"tmp/fusioncharts-smartlabel-1.0.2.tgz_1483380614986_0.5448229082394391","host":"packages-18-east.internal.npmjs.com"}},"2.0.0":{"name":"fusioncharts-smartlabel","version":"2.0.0","keywords":["smartlabel","fusioncharts","text","svg","canvas"],"author":{"name":"FusionCharts Technologies  &lt;support@fusioncharts.com&gt;"},"license":"MIT","_id":"fusioncharts-smartlabel@2.0.0","maintainers":[{"name":"fusioncharts","email":"mail@labs.fusioncharts.com"}],"contributors":[{"name":"Akash Goswami"},{"name":"Priyanjit Dey"},{"name":"Rohit Kumar"},{"name":"Shamasis Bhattacharya"},{"name":"Subhash Haldar"}],"homepage":"https://github.com/fusioncharts/fusioncharts-smartlabel","bugs":{"url":"https://github.com/fusioncharts/fusioncharts-smartlabel/issues"},"dist":{"shasum":"734b8033174069edb8defe2ab7869ebff451a1e7","tarball":"https://registry.npmjs.org/fusioncharts-smartlabel/-/fusioncharts-smartlabel-2.0.0.tgz","fileCount":35,"integrity":"sha512-uCpbX5wr3pT2HMC2wQgalfTH2fdjec2VdUFtfk5pUr72glPstfLgSZ23eyKLiXcEvUp9RyKgazUAyXjjjXygjg==","signatures":[{"sig":"MEUCIHyhjkpxuZ7Qhv5H4khSlfPZdppqGAkPRTBPSkm7qPINAiEA9DIz4mDBiu6sSCX8LRfJuICD/ynGFFrFxgQ3iqNtc4c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":389264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc0qWvCRA9TVsSAnZWagAAfV4QAIicVnwQCU/tGTpOV3yY\nozcLcvOMe1KSEdGh3LH0xoYV1cw7lfMo2RTG0FUCYCpqi+belvpL5uJno1x2\ncpaXGmsV4WDcCCHAv3LTH2/xdx14tOrkvMKd0pxAzIV8SlGkyqt30EpUT9Cv\nl/lg7gs3Ku9/GH2iTOQPGzD65kxTZCWhhpwnQyRskpld7FBwMh7PsECi2GD4\niOtQzKbUaSWraTYkLTX+VbqxUYRLBU/B89dTuQwAH1gA2WHBUKECMBjEBfEA\ngCskjDQIPpp7aJYeis/DY7chh0B93ygpsuX95cq4pmw8AMLEHoWV7/OLQlOF\nVxL/J7eavG0/gfZcnwkluGHylgQ3HEmt3Te9qy0FbxE0I0sS5YUAaqNXJxOA\n9k5A3hP01uFpqxB/ccp4YTw9XmVGH2JNxCA9VdkLmxb7O/A9EgiMWreln2rP\nOCCg9eIbNTCG/nzcolSs5+jVA3GZjKWHXmhiYO2ntdtUJ1iHBYFc8b0J/pX+\nSBUxKkK4eF8tMKgZh9O2ZEB6JD/QinR8bGwcirS47Ms+KgFUmNnQWaIzQ7v7\nQTy852nnZ/drMwESg4+3J3gCkvKDxj/ze2DL7En7TBHEdEvy60/4chIdxrnd\nsLCf0kblDv/Yqmzw7FgymGSfYvB2Fl74qydVq2ZzWCqsE7D5zcQ7jXW20yyW\nqyCO\r\n=dN9E\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/fusioncharts-smartlabel.min.js","module":"es/SmartlabelManager.js","gitHead":"eafe44d40251e48f1c8aafaf9b2926068b40c2d5","scripts":{"lint":"eslint ./; true","test":"script/test","build":"rm -rf dist/ && npx webpack --dev && npx webpack --prod","start":"gulp dev","minify":"rm -rf es/ && npx babel src -d es --minified --no-comments","coveralls":"cat coverage/report-lcov/lcov.info | node node_modules/.bin/coveralls"},"_npmUser":{"name":"fusioncharts","email":"rohit@fusioncharts.com"},"repository":{"url":"git+https://github.com/fusioncharts/fusioncharts-smartlabel.git","type":"git"},"_npmVersion":"6.9.0","description":"SmartLabel component to measure and restrict text in svg / canvas","directories":{},"_nodeVersion":"10.4.1","_hasShrinkwrap":false,"browserify-shim":{"react":"global:React"},"devDependencies":{"d3":"^4.4.0","chai":"^3.5.0","gulp":"^3.9.1","karma":"^1.3.0","mocha":"^3.2.0","react":"^0.14.0","eslint":"^4.19.1","webpack":"^4.30.0","coveralls":"^2.11.15","react-dom":"^0.14.0","@babel/cli":"^7.4.3","karma-chai":"^0.1.0","@babel/core":"^7.4.3","karma-mocha":"^1.3.0","webpack-cli":"^3.3.0","babel-eslint":"^8.2.2","babel-loader":"^8.0.5","karma-coverage":"^1.1.1","@babel/preset-env":"^7.4.3","eslint-plugin-react":"^7.7.0","karma-spec-reporter":"0.0.26","karma-phantomjs-launcher":"^1.0.2","react-component-gulp-tasks":"^0.7.6"},"_npmOperationalInternal":{"tmp":"tmp/fusioncharts-smartlabel_2.0.0_1557308846291_0.6762040199012633","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"fusioncharts-smartlabel","version":"2.1.0","keywords":["smartlabel","fusioncharts","text","svg","canvas"],"author":{"name":"FusionCharts Technologies  &lt;support@fusioncharts.com&gt;"},"license":"MIT","_id":"fusioncharts-smartlabel@2.1.0","maintainers":[{"name":"pallavn","email":"rohit@fusioncharts.com"},{"name":"priyanjitdey94","email":"priyanjitcareer@gmail.com"},{"name":"roahnoid5","email":"rohanoid5@gmail.com"},{"name":"rohitkr","email":"rohit.kr001@gmail.com"},{"name":"shreyas-a","email":"shreyas.a24@gmail.com"}],"contributors":[{"name":"Akash Goswami"},{"name":"Priyanjit Dey"},{"name":"Rohit Kumar"},{"name":"Shamasis Bhattacharya"},{"name":"Subhash Haldar"}],"homepage":"https://github.com/fusioncharts/fusioncharts-smartlabel","bugs":{"url":"https://github.com/fusioncharts/fusioncharts-smartlabel/issues"},"dist":{"shasum":"c7d909b0698c9cc4b19fa55915c27e7829ed64af","tarball":"https://registry.npmjs.org/fusioncharts-smartlabel/-/fusioncharts-smartlabel-2.1.0.tgz","fileCount":36,"integrity":"sha512-kQ9jC2npWP1ZLmrHWCUTQCW7F+SXvTsssGNfdhguCC2ToDXnuAM/dxG2gvYqk4Bftq6MUMYazzbUsUV5XLEYAA==","signatures":[{"sig":"MEUCIQDr0csF2Nw1/o5mf1ANGkS+mUQg89LjDDE/Loi0kqTAVQIgOrtlCf/D8CXWMCAEO3orzah0dHS9du74yXSZztVpIcs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":393972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdVrT+CRA9TVsSAnZWagAA9poP/2FzMhpCvL2hyfAiynwY\niOtmKWsNhWbw12kqV0lOR21qFf9v/M9N6DaHePA4PGgzDh+L+BqkopjHMcNQ\n5fkp3oXlhqdA8IUbxerztbDKjkUsfYQSYePVvJVAPqJUguJeTfk7uGW7QmqL\n4zaF5cDWvVbGe39qOHxWuaUfSAXPkxyZAOx3C7BX5ctgxe3kJkaz8nP+fTPQ\nkZXd4NaKVu59vMvVRJ/5NLn+W6z3xR5Qi8hYfQP55UkjzwZl0QGMxj0UZJoM\n/f6bLku1T9C9kYjPur2Ah69yM5UKbe8G3uCae0zrfgY1+N0Z1M/rBi5M5t1p\n/NqLyncujYd4nuQe/ArpqEGbZ1mSFwamH0Zv8UKzcGe2TBJG9cT1zSR6FdOj\nBNnz+VGR3tJg/yaXATAt4CpdXcZC0t5Jfn0NJ5ZTOSrbgwVIStgGf8XjbRHW\nrsGJw8JseTrv00VmHtNcSGNXFb1bYQFrYchoIRNOvM9GW3by03id84sJ7mc/\ni7RbR2rqsP6Gh2iEpnLrhVdb1Log4I5Hiu++f/QD0uu7j86dVtmjUWJ6mddD\nL7wNieENtvCh8tNVVUkwCbLTgihrARWYy/KBte6ody54/G+suzZHff8SqsZa\nU1PRhAE38z7gQrrRdHTW9xV6aq1AHoci0W2sDQANyNAI1sUQcpVQAFFeNZR1\n8aRN\r\n=E+Xw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/fusioncharts-smartlabel.min.js","module":"es/SmartlabelManager.js","gitHead":"965c0a178596858b825905f9ca530dfe77a98c68","scripts":{"lint":"eslint ./; true","test":"script/test","build":"rm -rf dist/ && npx webpack --dev && npx webpack --prod","start":"gulp dev","minify":"rm -rf es/ && npx babel src -d es --minified --no-comments","coveralls":"cat coverage/report-lcov/lcov.info | node node_modules/.bin/coveralls"},"_npmUser":{"name":"priyanjitdey94","email":"priyanjitcareer@gmail.com"},"repository":{"url":"git+https://github.com/fusioncharts/fusioncharts-smartlabel.git","type":"git"},"_npmVersion":"6.4.1","description":"SmartLabel component to measure and restrict text in svg / canvas","directories":{},"_nodeVersion":"10.15.3","_hasShrinkwrap":false,"browserify-shim":{"react":"global:React"},"devDependencies":{"d3":"^4.4.0","chai":"^3.5.0","gulp":"^3.9.1","karma":"^1.3.0","mocha":"^3.2.0","react":"^0.14.0","eslint":"^4.19.1","webpack":"^4.30.0","coveralls":"^2.11.15","react-dom":"^0.14.0","@babel/cli":"^7.4.3","karma-chai":"^0.1.0","@babel/core":"^7.4.3","karma-mocha":"^1.3.0","webpack-cli":"^3.3.0","babel-eslint":"^8.2.2","babel-loader":"^8.0.5","karma-coverage":"^1.1.1","@babel/preset-env":"^7.4.3","eslint-plugin-react":"^7.7.0","karma-spec-reporter":"0.0.26","karma-phantomjs-launcher":"^1.0.2","react-component-gulp-tasks":"^0.7.6"},"_npmOperationalInternal":{"tmp":"tmp/fusioncharts-smartlabel_2.1.0_1565963517920_0.21223649563349123","host":"s3://npm-registry-packages"}},"2.1.2":{"name":"fusioncharts-smartlabel","version":"2.1.2","keywords":["smartlabel","fusioncharts","text","svg","canvas"],"author":{"name":"InfoSoft Global Pvt. Ltd.  &lt;support@fusioncharts.com&gt;"},"license":"MIT","_id":"fusioncharts-smartlabel@2.1.2","maintainers":[{"name":"pallavn","email":"rohit@fusioncharts.com"},{"name":"priyanjitdey94","email":"priyanjitcareer@gmail.com"},{"name":"roahnoid5","email":"rohanoid5@gmail.com"},{"name":"rohitkr","email":"rohit.kr001@gmail.com"},{"name":"shreyas-a","email":"shreyas.a24@gmail.com"},{"name":"siawo","email":"md.owais1994@gmail.com"}],"contributors":[{"name":"Akash Goswami"},{"name":"Priyanjit Dey"},{"name":"Rohit Kumar"},{"name":"Shamasis Bhattacharya"},{"name":"Subhash Haldar"}],"homepage":"https://github.com/fusioncharts/fusioncharts-smartlabel","bugs":{"url":"https://github.com/fusioncharts/fusioncharts-smartlabel/issues"},"dist":{"shasum":"99f430f496f4ccdc050ded19b094d1dfc9d93226","tarball":"https://registry.npmjs.org/fusioncharts-smartlabel/-/fusioncharts-smartlabel-2.1.2.tgz","fileCount":36,"integrity":"sha512-Q5y1gIYVeIU35BXaC49SPGciA/nBr/EGQERhj4mmMWWaQNelMUkAnyt1EsxzwkBlWeJiSebbFbxYBB5ejy9ucw==","signatures":[{"sig":"MEUCIQCuMAtfAu4uwIgVu247Tv+pr6W9GK7tv9ZZUlz/AvX+ZwIgQIy572SIhRbl6JZXlss9jI3dysdgiQcynFOhGPNsbXE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":394464,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeICQbCRA9TVsSAnZWagAAnBAP/i2MW1dDPkPDj0otFyOG\nY/0ZvRWXUIpg+XxevCOUAdRox7+N47Ftprm9Vxk1IA7FrsmiR31T9AKhOF3n\nfEZ6upoVkuhJtQxLo90Rf6p+qeUg+lp7DTyXF8P1DRfEkN6BfRZyjornAooG\n2I2UrRHTBdOs1HIjrGe8mFyJVxv4z4Y4hyee3NnDltE75IZh+gEYcL3bv/Cd\nhcmrktdzwfD5aoIvyLClud2ITnpYf7ID7X3mIxmz6uQKsXuEvz4GGlnKNxba\nRmaS8hKtviePDcTUZfAO6Bnly/Y95n7jCj/CEI3rhzr5nSswCRiOaVrKRQZ8\n/kHEqCdhFzoaSZwV1sPI+Uypn6eYU0BpqbB5/My6qzizImI2wPuzaRDAWFSv\niEK52D++lvN63ZR2QVQewnVnt4gPDmmhdd5s0Min3ZHn0lEQPo0NV+bFqnMV\nxO4y4OFowg4t0wkFsGHYh/hcXWYlYHNUA6aVai04EnUpZi9nfoEj7U4w1E3+\nXrWewF/503sr1INAjyzCweFfssR/QO/SPlrovf1h27+rPbgCl6nyhWZu+mBJ\nvpWa+p8qw0IgsXBQzzNcLcipRIFNafSorR/sHGRhCuKUV6/427n++StG5/Hu\nGcEhFypdjZX74zLCSFoWpLrSqzGJw2qtlvzvj8p7TciiRNA6BKCjQ83y2rvv\nWREZ\r\n=GraE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/fusioncharts-smartlabel.min.js","module":"es/SmartlabelManager.js","gitHead":"08fe62c1dc41c0dfe3eff86044eb4704ba3cc04a","scripts":{"lint":"eslint ./; true","test":"script/test","build":"rm -rf dist/ && npx webpack --dev && npx webpack --prod","start":"gulp dev","minify":"rm -rf es/ && npx babel src -d es --minified --no-comments","coveralls":"cat coverage/report-lcov/lcov.info | node node_modules/.bin/coveralls"},"_npmUser":{"name":"priyanjitdey94","email":"priyanjitcareer@gmail.com"},"repository":{"url":"git+https://github.com/fusioncharts/fusioncharts-smartlabel.git","type":"git"},"_npmVersion":"6.4.1","description":"SmartLabel component to measure and restrict text in svg / canvas","directories":{},"_nodeVersion":"10.15.3","_hasShrinkwrap":false,"browserify-shim":{"react":"global:React"},"devDependencies":{"d3":"^4.4.0","chai":"^3.5.0","gulp":"^3.9.1","karma":"^1.3.0","mocha":"^3.2.0","react":"^0.14.0","eslint":"^4.19.1","webpack":"^4.30.0","coveralls":"^2.11.15","react-dom":"^0.14.0","@babel/cli":"^7.4.3","karma-chai":"^0.1.0","@babel/core":"^7.4.3","karma-mocha":"^1.3.0","webpack-cli":"^3.3.0","babel-eslint":"^8.2.2","babel-loader":"^8.0.5","karma-coverage":"^1.1.1","@babel/preset-env":"^7.4.3","eslint-plugin-react":"^7.7.0","karma-spec-reporter":"0.0.26","karma-phantomjs-launcher":"^1.0.2","react-component-gulp-tasks":"^0.7.6"},"_npmOperationalInternal":{"tmp":"tmp/fusioncharts-smartlabel_2.1.2_1579164699235_0.2809376178935632","host":"s3://npm-registry-packages"}}},"time":{"created":"2017-01-02T10:33:13.681Z","modified":"2024-06-19T09:47:30.179Z","1.0.1":"2017-01-02T10:33:13.681Z","1.0.2":"2017-01-02T18:10:15.716Z","2.0.0":"2019-05-08T09:47:26.694Z","2.1.0":"2019-08-16T13:51:58.069Z","2.1.2":"2020-01-16T08:51:39.326Z"},"maintainers":[{"email":"hmeherranjan@gmail.com","name":"meherhowji"}],"author":{"name":"InfoSoft Global Pvt. Ltd.  &lt;support@fusioncharts.com&gt;"},"repository":{"url":"git+https://github.com/fusioncharts/fusioncharts-smartlabel.git","type":"git"},"keywords":["smartlabel","fusioncharts","text","svg","canvas"],"license":"MIT","homepage":"https://github.com/fusioncharts/fusioncharts-smartlabel","bugs":{"url":"https://github.com/fusioncharts/fusioncharts-smartlabel/issues"},"readme":"# SmartLabel [![Build Status](https://travis-ci.org/fusioncharts/fusioncharts-smartlabel.svg?branch=develop)](https://travis-ci.org/fusioncharts/fusioncharts-smartlabel) [![Coverage Status](https://coveralls.io/repos/github/fusioncharts/fusioncharts-smartlabel/badge.svg?branch=develop)](https://coveralls.io/github/fusioncharts/fusioncharts-smartlabel?branch=develop)\n\nSmartLabel is a component which can be used to measure and restrict text in svg / canvas where the layout engine does not automatically takes care of the text behaviours.\n\n\n## Concept\n\nLive demo: [fusioncharts.github.io/fusioncharts-smartlabel](http://fusioncharts.github.io/fusioncharts-smartlabel/)\n\nTo build the examples locally, run:\n\n```javascript\nnpm install\nnpm start\n```\n\nThen open [`localhost:8000`](http://localhost:8000) in a browser.\n\n\n## Installation\n\nThe easiest way to use fusioncharts-smartlabel is to install it from NPM and include it in your own build process (using [Browserify](http://browserify.org), [Webpack](http://webpack.github.io/), etc).\n\nYou can also use the standalone build by including `dist/fusioncharts-smartlabel.js`\n\n```javascript\nnpm install fusioncharts-smartlabel --save\n```\n\n\n## API\n\n__Please see the concept above before proceeding__\n\n\nSmartLabel is immensely useful when text needs to be drawn in SVG or Canvas. Since SVG / Canvas does not manage text, it is necessary to have pre procressing on the text before getting it rendered.\n\nSmartLabel provides out of the box features to\n- If a bound box is provided it wraps / truncates the text\n- Calculate the metrics (height and width) of text for any style\n- Add ellipses if the text is truncated\n- Wraps a label in the bound box\n\n\nTo Create a new instance\n```javascript\nimport SmartLabel from 'fusioncharts-smartlabel'\n/*\n * Create new instance of SmartLabel.\n *\n * SmartLabel controls the lifetime of the execution space where the text's metrics will be calculated.\n * This takes a string for a given style and returns the height, width.\n * If a bound box is defined it wraps the text and returns the wrapped height and width.\n * It allows to append ellipsis at the end if the text is truncated.\n *\n * @param {String | HTMLElement} container - The id or the instance of the container where the intermediate dom\n *                              elements are to be attached. If not passed, it appends in body.\n *\n * @param {Boolean} useEllipses - This decides if a ellipses to be appended if the text is truncated.\n * @param {Object} options - Control options\n *                          {\n *                              maxCacheLimit: No of letter to be cached. Default: 500.\n *                          }\n * @constructor\n */\nvar sl =  new SmartLabel(container, useEllipses, options)\n```\n\nTo apply style before calculating text metrics\n```javascript\n/*\n * Sets the style based on which the text's metrics to be calculated.\n *\n * @param {Object} style - The style object which affects the text size\n *                      {\n *                          fontSize / 'font-size' : MUST BE FOLLOWED BY PX (10px, 11px)\n *                          fontFamily / 'font-family'\n *                          fontWeight / 'font-weight'\n *                          fontStyle / 'font-style'\n *                      }\n *\n * @return {SmartLabel} - Current instance of SmartLabel\n */\nsl.setStyle(style);\n```\n\nDecide whether the text would have trailing ellipses if truncated\n```javascript\n/*\n * Decides whether ellipses to be shown if the node is truncated\n *\n * @param {Boolean} useEllipses - decides if a ellipses to be appended if the text is truncated. Default: false\n *\n * @return {SmartLabel} - Current instance of SmartLabel\n */\nsl.useEllipsesOnOverflow(useEllipses);\n```\n\nTo get the text bounded by a bound box\n```javascript\n/*\n * Get wrapped or truncated text if a bound box is defined around it. The result text would be separated by <br/>\n * if wrapped\n *\n * @param {String} text - the subject text\n * @param {Number} maxWidth - width in px of the the bound box\n * @param {Number} maxHeight - height in px of the the bound box\n * @param {Boolean} noWrap - whether the text not to be wrapped. Default false i.e. by default wrapping is enabled.\n *\n * @return {Object} - The metrics of the text bounded by the box\n *                  {\n *                      height : height of the wrapped text\n *                      width : width of the wrapped text\n *                      isTruncated : whether the text is truncated\n *                      maxHeight : Maximum height given\n *                      maxWidth : Maximum width given\n *                      oriText : Original text sent\n *                      oriTextHeight : Original text height\n *                      oriTextWidth : Original text width\n *                      text : SMART TEXT\n *                  }\n */\nsmartlabel = sl.getSmartText(text, maxWidth, maxHeight, noWrap);\n```\n\nTo get the lines for a truncated text\n```javascript\n/*\n * getSmartText returns the text separated by <br/> whenever a break is necessary. This is to recgonize one\n * generalized format independent of the implementation (html5 based solution, canvas based solution, svg based solution).\n * This method converts the output of getSmartText().text to array of lines if the text is wrapped. It sets a named property\n * `lines` on the object passed as parameter.\n *\n * @param {Object} smartlabel - the object returned by getSmartText based on which line arr which to be formed.\n *\n * @return {Object} - The same object which was passed in the arguments. Also a named property `lines` is set.\n */\n smartlabel = sl.getSmartText(text, maxWidth, maxHeight, noWrap);\n generalizedSmartlabel = SmartLabel.textToLines(smartlabel);\n```\n\nTo get the size of a given text\n```javascript\n/*\n * Get the height and width of a text.\n *\n * @param {String} text - Text whose metrics to be measured\n * @param {Boolean} Optional detailedCalculationFlag - this flag if set it calculates per letter position\n *                          information and returns it. Ideally you dont need it unless you want to post process the\n *                          string. And its an EXPENSIVE OPERATION.\n *\n * @return {Object} - If detailedCalculationFlag is set to true the returned object would be\n *                  {``\n *                      height: height of the text\n *                      width: width of the text\n *                      detailObj: detail calculation of letters in the format {lettername: width}\n *                  }\n *                  If detailedCalculationFlag is set to false the returned object wont have the detailObj prop.\n */\nsize = sl.getSize(text, detailedCalculationFlag);\n```\n\nTo dispose the components\n```javascript\n/*\n * Dispose the container and object allocated by the smartlabel\n */\nsl.dispose();\n```\n\n## Usage\n\nA visualization library requires to restrict a text in a bound box to eliminate over lapping. The use case of the application of SmartLabel is huge, however we are taking a small subset of the universal set.\n\nFor a typical column chart the labels in X axis conveys category information. It's important to display the labels properly in the visualization. But there are many parameters which affect the label placement.\nIf the chart is displayed in a space which is large enough to accommodate all the labels, then it is desired to place all the labels in one line\n![labels in one line](example/img/mode-orig.png \"labels in one line\")\n\nIf the space is not enough to place all the labels side by side, it's required to wrap or truncate it.\n![labels wrapped](example/img/mode-1.png \"labels wrapped\")\n\nIt's some time desired to skip the labels as well if the category is continuous (Like month of the years)\n![label skipped](example/img/mode-2.png \"label skipped\")\n\nAll this can be eaisly done using SmartLabel.\n\nFollowing is the example of how a text is constrained by a bound box.\n```javascript\n// Set the vertical alignment on already created text node\ntext\n\t.attr('dy', \".35em\");\n\n// Let smartlabel know ellipses is required if the text is truncated.\n// Get the text restricted by a bound box which has 100px width and 200px height\nsmarttext = this.smartlabel\n\t.useEllipsesOnOverflow(true)\n\t.getSmartText('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididun', 100, 200);\n\n// Get all the lines in an array. SmartLabel injects <br/> whereever a wrap is required, this conversion is necessary.\nnormalizedSL = SmartLabel.textToLines(smarttext);\n\n// Create tspan. For more than one line create more than one tspan\ntspan = text\n\t.selectAll('tspan')\n\t.data(smarttext.lines);\n\n// Perform data joining operations of d3 on the tspans\ntspan\n\t.enter()\n\t\t.append('tspan')\n\t.merge(tspan)\n\t\t.attr(\"dy\", normalizedSL.oriTextHeight)\n\t\t.attr(\"x\", 0)\n\t\t.text(d => d);\n\n```\n\n## License\n\n__MIT__\n\nCopyright (c) 2016 InfoSoft Global Pvt. Ltd.  &lt;support@fusioncharts.com&gt;.\n","readmeFilename":"README.md","contributors":[{"name":"Akash Goswami"},{"name":"Priyanjit Dey"},{"name":"Rohit Kumar"},{"name":"Shamasis Bhattacharya"},{"name":"Subhash Haldar"}]}