anatomogram
Advanced tools
Comparing version 1.2.9 to 1.2.10
@@ -23,6 +23,4 @@ 'use strict'; | ||
var _urijs = require('urijs'); | ||
var _Assets = require('./Assets.js'); | ||
var _urijs2 = _interopRequireDefault(_urijs); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -178,3 +176,3 @@ | ||
_react2.default.createElement(_reactSvg2.default, { | ||
path: (0, _urijs2.default)('svg/' + this.props.filename, this.props.urlToResources).toString(), | ||
path: (0, _Assets.resolveUrlToAnatomogram)(this.props.urlToResources, this.props.filename), | ||
callback: function callback(svgDomNode) { | ||
@@ -181,0 +179,0 @@ _this2._initialiseSvgElements(getSvgElementById(svgDomNode)); |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
@@ -21,34 +21,32 @@ | ||
var _Assets = require('./Assets.js'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var resolveUrlToIcon = function resolveUrlToIcon(urlToResources, selectedType, anatomogramType) { | ||
return (0, _urijs2.default)('img/' + (selectedType === anatomogramType ? '' : 'un') + 'selected' + anatomogramType + '.png', urlToResources).toString(); | ||
}; | ||
var Switcher = function Switcher(_ref) { | ||
var anatomogramTypes = _ref.anatomogramTypes, | ||
urlToResources = _ref.urlToResources, | ||
selectedType = _ref.selectedType, | ||
onChangeSelectedType = _ref.onChangeSelectedType; | ||
return anatomogramTypes.length > 1 && _react2.default.createElement( | ||
'div', | ||
{ style: { display: 'inline-block', verticalAlign: 'top', width: '10%', maxWidth: '32px' } }, | ||
anatomogramTypes.map(function (anatomogramType) { | ||
return _react2.default.createElement('img', { key: anatomogramType, | ||
className: 'gxa-selection-icon', | ||
onClick: function onClick() { | ||
return onChangeSelectedType(anatomogramType); | ||
}, | ||
src: resolveUrlToIcon(urlToResources, selectedType, anatomogramType) }); | ||
}) | ||
); | ||
var anatomogramTypes = _ref.anatomogramTypes, | ||
urlToResources = _ref.urlToResources, | ||
selectedType = _ref.selectedType, | ||
onChangeSelectedType = _ref.onChangeSelectedType; | ||
return anatomogramTypes.length > 1 && _react2.default.createElement( | ||
'div', | ||
{ style: { display: 'inline-block', verticalAlign: 'top', width: '10%', maxWidth: '32px' } }, | ||
anatomogramTypes.map(function (anatomogramType) { | ||
return _react2.default.createElement('img', { key: anatomogramType, | ||
className: 'gxa-selection-icon', | ||
onClick: function onClick() { | ||
return onChangeSelectedType(anatomogramType); | ||
}, | ||
src: (0, _Assets.resolveUrlToIcon)(urlToResources, selectedType, anatomogramType) }); | ||
}) | ||
); | ||
}; | ||
Switcher.propTypes = { | ||
anatomogramTypes: _propTypes2.default.arrayOf(_propTypes2.default.string).isRequired, | ||
selectedType: _propTypes2.default.string.isRequired, | ||
onChangeSelectedType: _propTypes2.default.func.isRequired, | ||
urlToResources: _propTypes2.default.string.isRequired | ||
anatomogramTypes: _propTypes2.default.arrayOf(_propTypes2.default.string).isRequired, | ||
selectedType: _propTypes2.default.string.isRequired, | ||
onChangeSelectedType: _propTypes2.default.func.isRequired, | ||
urlToResources: _propTypes2.default.string.isRequired | ||
}; | ||
exports.default = Switcher; |
{ | ||
"name": "anatomogram", | ||
"version": "1.2.9", | ||
"version": "1.2.10", | ||
"description": "Anatomogram component for Expression Atlas heatmap", | ||
@@ -8,3 +8,3 @@ "main": "lib/index.js", | ||
"parseSvgs": "node scripts/svgParse.js src/svg > src/json/svgsMetadata.json ", | ||
"prepublishOnly": "yarn run parseSvgs && rm -rf lib && babel src -d lib --ignore '**/*.less','**/*.sass' --copy-files", | ||
"prepublish": "yarn run parseSvgs && rm -rf lib && babel src -d lib --ignore '**/*.less','**/*.sass' --copy-files", | ||
"dist": "NODE_ENV=production webpack --debug --optimize-minimize --output-pathinfo --display-chunks --display-modules", | ||
@@ -11,0 +11,0 @@ "test": "jest --coverage || echo 'LOL tests failed'", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
13399241
51
1048