@fluentui/react-charting 5.10.0 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +72 -1
- package/CHANGELOG.md +32 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/Sparkline.d.ts +1 -0
- package/lib/Sparkline.js +2 -0
- package/lib/Sparkline.js.map +1 -0
- package/lib/TreeChart.d.ts +1 -0
- package/lib/TreeChart.js +2 -0
- package/lib/TreeChart.js.map +1 -0
- package/lib/Utilities.d.ts +1 -1
- package/lib/Utilities.js +4 -2
- package/lib/Utilities.js.map +1 -1
- package/lib/components/Sparkline/Sparkline.base.d.ts +18 -0
- package/lib/components/Sparkline/Sparkline.base.js +65 -0
- package/lib/components/Sparkline/Sparkline.base.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.d.ts +3 -0
- package/lib/components/Sparkline/Sparkline.js +6 -0
- package/lib/components/Sparkline/Sparkline.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.styles.d.ts +2 -0
- package/lib/components/Sparkline/Sparkline.styles.js +10 -0
- package/lib/components/Sparkline/Sparkline.styles.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.types.d.ts +46 -0
- package/lib/components/Sparkline/Sparkline.types.js +2 -0
- package/lib/components/Sparkline/Sparkline.types.js.map +1 -0
- package/lib/components/Sparkline/index.d.ts +2 -0
- package/lib/components/Sparkline/index.js +3 -0
- package/lib/components/Sparkline/index.js.map +1 -0
- package/lib/components/TreeChart/TreeChart.base.d.ts +18 -0
- package/lib/components/TreeChart/TreeChart.base.js +239 -0
- package/lib/components/TreeChart/TreeChart.base.js.map +1 -0
- package/lib/components/TreeChart/TreeChart.d.ts +3 -0
- package/lib/components/TreeChart/TreeChart.js +5 -0
- package/lib/components/TreeChart/TreeChart.js.map +1 -0
- package/lib/components/TreeChart/TreeChart.styles.d.ts +2 -0
- package/lib/components/TreeChart/TreeChart.styles.js +20 -0
- package/lib/components/TreeChart/TreeChart.styles.js.map +1 -0
- package/lib/components/TreeChart/TreeChart.types.d.ts +88 -0
- package/lib/components/TreeChart/TreeChart.types.js +11 -0
- package/lib/components/TreeChart/TreeChart.types.js.map +1 -0
- package/lib/components/TreeChart/index.d.ts +2 -0
- package/lib/components/TreeChart/index.js +3 -0
- package/lib/components/TreeChart/index.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/lib-amd/Sparkline.d.ts +1 -0
- package/lib-amd/Sparkline.js +6 -0
- package/lib-amd/Sparkline.js.map +1 -0
- package/lib-amd/TreeChart.d.ts +1 -0
- package/lib-amd/TreeChart.js +6 -0
- package/lib-amd/TreeChart.js.map +1 -0
- package/lib-amd/Utilities.d.ts +1 -1
- package/lib-amd/Utilities.js +3 -1
- package/lib-amd/Utilities.js.map +1 -1
- package/lib-amd/components/Sparkline/Sparkline.base.d.ts +18 -0
- package/lib-amd/components/Sparkline/Sparkline.base.js +63 -0
- package/lib-amd/components/Sparkline/Sparkline.base.js.map +1 -0
- package/lib-amd/components/Sparkline/Sparkline.d.ts +3 -0
- package/lib-amd/components/Sparkline/Sparkline.js +8 -0
- package/lib-amd/components/Sparkline/Sparkline.js.map +1 -0
- package/lib-amd/components/Sparkline/Sparkline.styles.d.ts +2 -0
- package/lib-amd/components/Sparkline/Sparkline.styles.js +15 -0
- package/lib-amd/components/Sparkline/Sparkline.styles.js.map +1 -0
- package/lib-amd/components/Sparkline/Sparkline.types.d.ts +46 -0
- package/lib-amd/components/Sparkline/Sparkline.types.js +5 -0
- package/lib-amd/components/Sparkline/Sparkline.types.js.map +1 -0
- package/lib-amd/components/Sparkline/index.d.ts +2 -0
- package/lib-amd/components/Sparkline/index.js +7 -0
- package/lib-amd/components/Sparkline/index.js.map +1 -0
- package/lib-amd/components/TreeChart/TreeChart.base.d.ts +18 -0
- package/lib-amd/components/TreeChart/TreeChart.base.js +238 -0
- package/lib-amd/components/TreeChart/TreeChart.base.js.map +1 -0
- package/lib-amd/components/TreeChart/TreeChart.d.ts +3 -0
- package/lib-amd/components/TreeChart/TreeChart.js +7 -0
- package/lib-amd/components/TreeChart/TreeChart.js.map +1 -0
- package/lib-amd/components/TreeChart/TreeChart.styles.d.ts +2 -0
- package/lib-amd/components/TreeChart/TreeChart.styles.js +25 -0
- package/lib-amd/components/TreeChart/TreeChart.styles.js.map +1 -0
- package/lib-amd/components/TreeChart/TreeChart.types.d.ts +88 -0
- package/lib-amd/components/TreeChart/TreeChart.types.js +16 -0
- package/lib-amd/components/TreeChart/TreeChart.types.js.map +1 -0
- package/lib-amd/components/TreeChart/index.d.ts +2 -0
- package/lib-amd/components/TreeChart/index.js +7 -0
- package/lib-amd/components/TreeChart/index.js.map +1 -0
- package/lib-amd/index.d.ts +2 -0
- package/lib-amd/index.js +3 -1
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/version.js +1 -1
- package/lib-amd/version.js.map +1 -1
- package/lib-commonjs/Sparkline.d.ts +1 -0
- package/lib-commonjs/Sparkline.js +5 -0
- package/lib-commonjs/Sparkline.js.map +1 -0
- package/lib-commonjs/TreeChart.d.ts +1 -0
- package/lib-commonjs/TreeChart.js +5 -0
- package/lib-commonjs/TreeChart.js.map +1 -0
- package/lib-commonjs/Utilities.d.ts +1 -1
- package/lib-commonjs/Utilities.js +6 -4
- package/lib-commonjs/Utilities.js.map +1 -1
- package/lib-commonjs/components/Sparkline/Sparkline.base.d.ts +18 -0
- package/lib-commonjs/components/Sparkline/Sparkline.base.js +68 -0
- package/lib-commonjs/components/Sparkline/Sparkline.base.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.d.ts +3 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js +9 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.styles.d.ts +2 -0
- package/lib-commonjs/components/Sparkline/Sparkline.styles.js +14 -0
- package/lib-commonjs/components/Sparkline/Sparkline.styles.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.types.d.ts +46 -0
- package/lib-commonjs/components/Sparkline/Sparkline.types.js +3 -0
- package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -0
- package/lib-commonjs/components/Sparkline/index.d.ts +2 -0
- package/lib-commonjs/components/Sparkline/index.js +6 -0
- package/lib-commonjs/components/Sparkline/index.js.map +1 -0
- package/lib-commonjs/components/TreeChart/TreeChart.base.d.ts +18 -0
- package/lib-commonjs/components/TreeChart/TreeChart.base.js +242 -0
- package/lib-commonjs/components/TreeChart/TreeChart.base.js.map +1 -0
- package/lib-commonjs/components/TreeChart/TreeChart.d.ts +3 -0
- package/lib-commonjs/components/TreeChart/TreeChart.js +8 -0
- package/lib-commonjs/components/TreeChart/TreeChart.js.map +1 -0
- package/lib-commonjs/components/TreeChart/TreeChart.styles.d.ts +2 -0
- package/lib-commonjs/components/TreeChart/TreeChart.styles.js +24 -0
- package/lib-commonjs/components/TreeChart/TreeChart.styles.js.map +1 -0
- package/lib-commonjs/components/TreeChart/TreeChart.types.d.ts +88 -0
- package/lib-commonjs/components/TreeChart/TreeChart.types.js +14 -0
- package/lib-commonjs/components/TreeChart/TreeChart.types.js.map +1 -0
- package/lib-commonjs/components/TreeChart/index.d.ts +2 -0
- package/lib-commonjs/components/TreeChart/index.js +6 -0
- package/lib-commonjs/components/TreeChart/index.js.map +1 -0
- package/lib-commonjs/index.d.ts +2 -0
- package/lib-commonjs/index.js +2 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/version.js +1 -1
- package/lib-commonjs/version.js.map +1 -1
- package/package.json +6 -4
- package/src/components/Sparkline/Sparkline.types.ts +55 -0
- package/src/components/TreeChart/TreeChart.types.ts +89 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/Sparkline/index';
|
package/lib/Sparkline.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sparkline.js","sourceRoot":"../src/","sources":["Sparkline.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC","sourcesContent":["export * from './components/Sparkline/index';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/TreeChart/index';
|
package/lib/TreeChart.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeChart.js","sourceRoot":"../src/","sources":["TreeChart.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC","sourcesContent":["export * from './components/TreeChart/index';\n"]}
|
package/lib/Utilities.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Async, AutoScroll, BaseComponent, Customizations, Customizer, CustomizerContext, DATA_IS_SCROLLABLE_ATTRIBUTE, DATA_PORTAL_ATTRIBUTE, DelayedRender, EventGroup, FabricPerformance, FocusRects, GlobalSettings, IsFocusVisibleClassName, KeyCodes, Rectangle, SELECTION_CHANGE, Selection, SelectionDirection, SelectionMode, addDirectionalKeyCode, addElementAtIndex, allowOverscrollOnElement, allowScrollOnElement, anchorProperties, appendFunction, arraysEqual, asAsync, assertNever, assign, audioProperties, baseElementEvents, baseElementProperties, buttonProperties, calculatePrecision, classNamesFunction, colGroupProperties, colProperties, composeComponentAs, composeRenderFunction, createArray, createMemoizer, createMergedRef, css, customizable, disableBodyScroll, divProperties, doesElementContainFocus, elementContains, elementContainsAttribute, enableBodyScroll, extendComponent, filteredAssign, find, findElementRecursive, findIndex, findScrollableParent, fitContentToBounds, flatten, focusAsync, focusFirstChild, formProperties, format, getChildren, getDistanceBetweenPoints, getDocument, getElementIndexPath, getFirstFocusable, getFirstTabbable, getFirstVisibleElementFromSelector, getFocusableByIndexPath, getId, getInitials, getLanguage, getLastFocusable, getLastTabbable, getNativeElementProps, getNativeProps, getNextElement, getParent, getPreviousElement, getPropsWithDefaults, getRTL, getRTLSafeKeyCode, getRect, getResourceUrl, getScrollbarWidth, getVirtualParent, getWindow, hasHorizontalOverflow, hasOverflow, hasVerticalOverflow, hoistMethods, hoistStatics, htmlElementProperties, iframeProperties, imageProperties, imgProperties, initializeComponentRef, initializeFocusRects, inputProperties, isControlled, isDirectionalKeyCode, isElementFocusSubZone, isElementFocusZone, isElementTabbable, isElementVisible, isElementVisibleAndNotHidden, isIE11, isIOS, isMac, isVirtualElement, labelProperties, liProperties, mapEnumByName, memoize, memoizeFunction, merge, mergeAriaAttributeValues, mergeCustomizations, mergeScopedSettings, mergeSettings, modalize, nullRender, olProperties, omit, on, optionProperties, portalContainsElement, precisionRound, raiseClick, removeIndex, replaceElement, resetControlledWarnings, resetIds, resetMemoizations, safeRequestAnimationFrame, safeSetTimeout, selectProperties, setBaseUrl, setFocusVisibility, setLanguage, setMemoizeWeakMap, setPortalAttribute, setRTL, setSSR, setVirtualParent, setWarningCallback, shallowCompare, shouldWrapFocus, styled, tableProperties, tdProperties, textAreaProperties, thProperties, toMatrix, trProperties, unhoistMethods, useCustomizationSettings, useFocusRects, values, videoProperties, warn, warnConditionallyRequiredProps, warnControlledUsage, warnDeprecations, warnMutuallyExclusive, } from '@fluentui/react/lib/Utilities';
|
|
1
|
+
export { Async, AutoScroll, BaseComponent, Customizations, Customizer, CustomizerContext, DATA_IS_SCROLLABLE_ATTRIBUTE, DATA_PORTAL_ATTRIBUTE, DelayedRender, EventGroup, FabricPerformance, FocusRects, GlobalSettings, IsFocusVisibleClassName, KeyCodes, Rectangle, SELECTION_CHANGE, Selection, SelectionDirection, SelectionMode, addDirectionalKeyCode, addElementAtIndex, allowOverscrollOnElement, allowScrollOnElement, anchorProperties, appendFunction, arraysEqual, asAsync, assertNever, assign, audioProperties, baseElementEvents, baseElementProperties, buttonProperties, calculatePrecision, canUseDOM, classNamesFunction, colGroupProperties, colProperties, composeComponentAs, composeRenderFunction, createArray, createMemoizer, createMergedRef, css, customizable, disableBodyScroll, divProperties, doesElementContainFocus, elementContains, elementContainsAttribute, enableBodyScroll, extendComponent, filteredAssign, find, findElementRecursive, findIndex, findScrollableParent, fitContentToBounds, flatten, focusAsync, focusFirstChild, formProperties, format, getChildren, getDistanceBetweenPoints, getDocument, getElementIndexPath, getFirstFocusable, getFirstTabbable, getFirstVisibleElementFromSelector, getFocusableByIndexPath, getId, getInitials, getLanguage, getLastFocusable, getLastTabbable, getNativeElementProps, getNativeProps, getNextElement, getParent, getPreviousElement, getPropsWithDefaults, getRTL, getRTLSafeKeyCode, getRect, getResourceUrl, getScrollbarWidth, getVirtualParent, getWindow, hasHorizontalOverflow, hasOverflow, hasVerticalOverflow, hoistMethods, hoistStatics, htmlElementProperties, iframeProperties, imageProperties, imgProperties, initializeComponentRef, initializeFocusRects, inputProperties, isControlled, isDirectionalKeyCode, isElementFocusSubZone, isElementFocusZone, isElementTabbable, isElementVisible, isElementVisibleAndNotHidden, isIE11, isIOS, isMac, isVirtualElement, labelProperties, liProperties, mapEnumByName, memoize, memoizeFunction, merge, mergeAriaAttributeValues, mergeCustomizations, mergeScopedSettings, mergeSettings, modalize, nullRender, olProperties, omit, on, optionProperties, portalContainsElement, precisionRound, raiseClick, removeIndex, replaceElement, resetControlledWarnings, resetIds, resetMemoizations, safeRequestAnimationFrame, safeSetTimeout, selectProperties, setBaseUrl, setFocusVisibility, setLanguage, setMemoizeWeakMap, setPortalAttribute, setRTL, setSSR, setVirtualParent, setWarningCallback, shallowCompare, shouldWrapFocus, styled, tableProperties, tdProperties, textAreaProperties, thProperties, toMatrix, trProperties, unhoistMethods, useCustomizationSettings, useFocusRects, values, videoProperties, warn, warnConditionallyRequiredProps, warnControlledUsage, warnDeprecations, warnMutuallyExclusive, } from '@fluentui/react/lib/Utilities';
|
|
2
2
|
export type { FitMode, IAsAsyncOptions, IBaseProps, ICancelable, IChangeDescription, IChangeEventCallback, IClassNames, IClassNamesFunctionOptions, IComponentAs, IComponentAsProps, ICssInput, ICustomizableProps, ICustomizations, ICustomizerContext, ICustomizerProps, IDeclaredEventsByName, IDelayedRenderProps, IDelayedRenderState, IDictionary, IDisposable, IEventRecord, IEventRecordList, IEventRecordsByName, IFitContentToBoundsOptions, IObjectWithKey, IPerfData, IPerfMeasurement, IPerfSummary, IPoint, IPropsWithStyles, IRectangle, IRefObject, IRenderComponent, IRenderFunction, ISelection, ISelectionOptions, ISelectionOptionsWithRequiredGetKey, ISerializableObject, ISettings, ISettingsFunction, ISettingsMap, ISize, IStyleFunction, IStyleFunctionOrObject, IVirtualElement, IWarnControlledUsageParams, Omit, Point, RefObject, Settings, SettingsFunction, StyleFunction, } from '@fluentui/react/lib/Utilities';
|
package/lib/Utilities.js
CHANGED
|
@@ -2,7 +2,7 @@ export { Async, AutoScroll,
|
|
|
2
2
|
// eslint-disable-next-line deprecation/deprecation
|
|
3
3
|
BaseComponent, Customizations,
|
|
4
4
|
// eslint-disable-next-line deprecation/deprecation
|
|
5
|
-
Customizer, CustomizerContext, DATA_IS_SCROLLABLE_ATTRIBUTE, DATA_PORTAL_ATTRIBUTE, DelayedRender, EventGroup, FabricPerformance, FocusRects, GlobalSettings, IsFocusVisibleClassName, KeyCodes, Rectangle, SELECTION_CHANGE, Selection, SelectionDirection, SelectionMode, addDirectionalKeyCode, addElementAtIndex, allowOverscrollOnElement, allowScrollOnElement, anchorProperties, appendFunction, arraysEqual, asAsync, assertNever, assign, audioProperties, baseElementEvents, baseElementProperties, buttonProperties, calculatePrecision, classNamesFunction, colGroupProperties, colProperties, composeComponentAs, composeRenderFunction, createArray, createMemoizer, createMergedRef, css, customizable, disableBodyScroll, divProperties, doesElementContainFocus, elementContains, elementContainsAttribute, enableBodyScroll, extendComponent, filteredAssign, find, findElementRecursive, findIndex, findScrollableParent, fitContentToBounds, flatten, focusAsync, focusFirstChild, formProperties, format, getChildren, getDistanceBetweenPoints, getDocument, getElementIndexPath, getFirstFocusable, getFirstTabbable, getFirstVisibleElementFromSelector, getFocusableByIndexPath, getId, getInitials, getLanguage, getLastFocusable, getLastTabbable, getNativeElementProps, getNativeProps, getNextElement, getParent, getPreviousElement, getPropsWithDefaults, getRTL, getRTLSafeKeyCode, getRect,
|
|
5
|
+
Customizer, CustomizerContext, DATA_IS_SCROLLABLE_ATTRIBUTE, DATA_PORTAL_ATTRIBUTE, DelayedRender, EventGroup, FabricPerformance, FocusRects, GlobalSettings, IsFocusVisibleClassName, KeyCodes, Rectangle, SELECTION_CHANGE, Selection, SelectionDirection, SelectionMode, addDirectionalKeyCode, addElementAtIndex, allowOverscrollOnElement, allowScrollOnElement, anchorProperties, appendFunction, arraysEqual, asAsync, assertNever, assign, audioProperties, baseElementEvents, baseElementProperties, buttonProperties, calculatePrecision, canUseDOM, classNamesFunction, colGroupProperties, colProperties, composeComponentAs, composeRenderFunction, createArray, createMemoizer, createMergedRef, css, customizable, disableBodyScroll, divProperties, doesElementContainFocus, elementContains, elementContainsAttribute, enableBodyScroll, extendComponent, filteredAssign, find, findElementRecursive, findIndex, findScrollableParent, fitContentToBounds, flatten, focusAsync, focusFirstChild, formProperties, format, getChildren, getDistanceBetweenPoints, getDocument, getElementIndexPath, getFirstFocusable, getFirstTabbable, getFirstVisibleElementFromSelector, getFocusableByIndexPath, getId, getInitials, getLanguage, getLastFocusable, getLastTabbable, getNativeElementProps, getNativeProps, getNextElement, getParent, getPreviousElement, getPropsWithDefaults, getRTL, getRTLSafeKeyCode, getRect,
|
|
6
6
|
// eslint-disable-next-line deprecation/deprecation
|
|
7
7
|
getResourceUrl, getScrollbarWidth, getVirtualParent, getWindow, hasHorizontalOverflow, hasOverflow, hasVerticalOverflow, hoistMethods, hoistStatics, htmlElementProperties, iframeProperties,
|
|
8
8
|
// eslint-disable-next-line deprecation/deprecation
|
|
@@ -14,5 +14,7 @@ raiseClick, removeIndex, replaceElement, resetControlledWarnings, resetIds, rese
|
|
|
14
14
|
// eslint-disable-next-line deprecation/deprecation
|
|
15
15
|
setBaseUrl, setFocusVisibility,
|
|
16
16
|
// eslint-disable-next-line deprecation/deprecation
|
|
17
|
-
setLanguage, setMemoizeWeakMap, setPortalAttribute, setRTL,
|
|
17
|
+
setLanguage, setMemoizeWeakMap, setPortalAttribute, setRTL,
|
|
18
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
19
|
+
setSSR, setVirtualParent, setWarningCallback, shallowCompare, shouldWrapFocus, styled, tableProperties, tdProperties, textAreaProperties, thProperties, toMatrix, trProperties, unhoistMethods, useCustomizationSettings, useFocusRects, values, videoProperties, warn, warnConditionallyRequiredProps, warnControlledUsage, warnDeprecations, warnMutuallyExclusive, } from '@fluentui/react/lib/Utilities';
|
|
18
20
|
//# sourceMappingURL=Utilities.js.map
|
package/lib/Utilities.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utilities.js","sourceRoot":"../src/","sources":["Utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,UAAU;AACV,mDAAmD;AACnD,aAAa,EACb,cAAc;AACd,mDAAmD;AACnD,UAAU,EACV,iBAAiB,EACjB,4BAA4B,EAC5B,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,uBAAuB,EACvB,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,OAAO,EACP,WAAW,EACX,MAAM,EACN,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,cAAc,EACd,eAAe,EACf,GAAG,EACH,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,uBAAuB,EACvB,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,IAAI,EACJ,oBAAoB,EACpB,SAAS,EAC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ities.js","sourceRoot":"../src/","sources":["Utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,UAAU;AACV,mDAAmD;AACnD,aAAa,EACb,cAAc;AACd,mDAAmD;AACnD,UAAU,EACV,iBAAiB,EACjB,4BAA4B,EAC5B,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,uBAAuB,EACvB,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,OAAO,EACP,WAAW,EACX,MAAM,EACN,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,cAAc,EACd,eAAe,EACf,GAAG,EACH,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,uBAAuB,EACvB,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,IAAI,EACJ,oBAAoB,EACpB,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,eAAe,EACf,cAAc,EACd,MAAM,EACN,WAAW,EACX,wBAAwB,EACxB,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,kCAAkC,EAClC,uBAAuB,EACvB,KAAK,EACL,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,oBAAoB,EACpB,MAAM,EACN,iBAAiB,EACjB,OAAO;AACP,mDAAmD;AACnD,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,qBAAqB,EACrB,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,gBAAgB;AAChB,mDAAmD;AACnD,eAAe,EACf,aAAa,EACb,sBAAsB;AACtB,mDAAmD;AACnD,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,4BAA4B,EAC5B,MAAM,EACN,KAAK,EACL,KAAK,EACL,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,OAAO,EACP,eAAe,EACf,KAAK,EACL,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,IAAI,EACJ,EAAE,EACF,gBAAgB,EAChB,qBAAqB,EACrB,cAAc;AACd,mDAAmD;AACnD,UAAU,EACV,WAAW,EACX,cAAc,EACd,uBAAuB,EACvB,QAAQ,EACR,iBAAiB,EACjB,yBAAyB,EACzB,cAAc,EACd,gBAAgB;AAChB,mDAAmD;AACnD,UAAU,EACV,kBAAkB;AAClB,mDAAmD;AACnD,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,MAAM;AACN,mDAAmD;AACnD,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,MAAM,EACN,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,wBAAwB,EACxB,aAAa,EACb,MAAM,EACN,eAAe,EACf,IAAI,EACJ,8BAA8B,EAC9B,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC","sourcesContent":["export {\n Async,\n AutoScroll,\n // eslint-disable-next-line deprecation/deprecation\n BaseComponent,\n Customizations,\n // eslint-disable-next-line deprecation/deprecation\n Customizer,\n CustomizerContext,\n DATA_IS_SCROLLABLE_ATTRIBUTE,\n DATA_PORTAL_ATTRIBUTE,\n DelayedRender,\n EventGroup,\n FabricPerformance,\n FocusRects,\n GlobalSettings,\n IsFocusVisibleClassName,\n KeyCodes,\n Rectangle,\n SELECTION_CHANGE,\n Selection,\n SelectionDirection,\n SelectionMode,\n addDirectionalKeyCode,\n addElementAtIndex,\n allowOverscrollOnElement,\n allowScrollOnElement,\n anchorProperties,\n appendFunction,\n arraysEqual,\n asAsync,\n assertNever,\n assign,\n audioProperties,\n baseElementEvents,\n baseElementProperties,\n buttonProperties,\n calculatePrecision,\n canUseDOM,\n classNamesFunction,\n colGroupProperties,\n colProperties,\n composeComponentAs,\n composeRenderFunction,\n createArray,\n createMemoizer,\n createMergedRef,\n css,\n customizable,\n disableBodyScroll,\n divProperties,\n doesElementContainFocus,\n elementContains,\n elementContainsAttribute,\n enableBodyScroll,\n extendComponent,\n filteredAssign,\n find,\n findElementRecursive,\n findIndex,\n findScrollableParent,\n fitContentToBounds,\n flatten,\n focusAsync,\n focusFirstChild,\n formProperties,\n format,\n getChildren,\n getDistanceBetweenPoints,\n getDocument,\n getElementIndexPath,\n getFirstFocusable,\n getFirstTabbable,\n getFirstVisibleElementFromSelector,\n getFocusableByIndexPath,\n getId,\n getInitials,\n getLanguage,\n getLastFocusable,\n getLastTabbable,\n getNativeElementProps,\n getNativeProps,\n getNextElement,\n getParent,\n getPreviousElement,\n getPropsWithDefaults,\n getRTL,\n getRTLSafeKeyCode,\n getRect,\n // eslint-disable-next-line deprecation/deprecation\n getResourceUrl,\n getScrollbarWidth,\n getVirtualParent,\n getWindow,\n hasHorizontalOverflow,\n hasOverflow,\n hasVerticalOverflow,\n hoistMethods,\n hoistStatics,\n htmlElementProperties,\n iframeProperties,\n // eslint-disable-next-line deprecation/deprecation\n imageProperties,\n imgProperties,\n initializeComponentRef,\n // eslint-disable-next-line deprecation/deprecation\n initializeFocusRects,\n inputProperties,\n isControlled,\n isDirectionalKeyCode,\n isElementFocusSubZone,\n isElementFocusZone,\n isElementTabbable,\n isElementVisible,\n isElementVisibleAndNotHidden,\n isIE11,\n isIOS,\n isMac,\n isVirtualElement,\n labelProperties,\n liProperties,\n mapEnumByName,\n memoize,\n memoizeFunction,\n merge,\n mergeAriaAttributeValues,\n mergeCustomizations,\n mergeScopedSettings,\n mergeSettings,\n modalize,\n nullRender,\n olProperties,\n omit,\n on,\n optionProperties,\n portalContainsElement,\n precisionRound,\n // eslint-disable-next-line deprecation/deprecation\n raiseClick,\n removeIndex,\n replaceElement,\n resetControlledWarnings,\n resetIds,\n resetMemoizations,\n safeRequestAnimationFrame,\n safeSetTimeout,\n selectProperties,\n // eslint-disable-next-line deprecation/deprecation\n setBaseUrl,\n setFocusVisibility,\n // eslint-disable-next-line deprecation/deprecation\n setLanguage,\n setMemoizeWeakMap,\n setPortalAttribute,\n setRTL,\n // eslint-disable-next-line deprecation/deprecation\n setSSR,\n setVirtualParent,\n setWarningCallback,\n shallowCompare,\n shouldWrapFocus,\n styled,\n tableProperties,\n tdProperties,\n textAreaProperties,\n thProperties,\n toMatrix,\n trProperties,\n unhoistMethods,\n useCustomizationSettings,\n useFocusRects,\n values,\n videoProperties,\n warn,\n warnConditionallyRequiredProps,\n warnControlledUsage,\n warnDeprecations,\n warnMutuallyExclusive,\n} from '@fluentui/react/lib/Utilities';\nexport type {\n FitMode,\n IAsAsyncOptions,\n IBaseProps,\n ICancelable,\n IChangeDescription,\n IChangeEventCallback,\n // eslint-disable-next-line deprecation/deprecation\n IClassNames,\n IClassNamesFunctionOptions,\n IComponentAs,\n IComponentAsProps,\n ICssInput,\n ICustomizableProps,\n ICustomizations,\n ICustomizerContext,\n ICustomizerProps,\n IDeclaredEventsByName,\n IDelayedRenderProps,\n IDelayedRenderState,\n IDictionary,\n IDisposable,\n IEventRecord,\n IEventRecordList,\n IEventRecordsByName,\n IFitContentToBoundsOptions,\n IObjectWithKey,\n IPerfData,\n IPerfMeasurement,\n IPerfSummary,\n // eslint-disable-next-line deprecation/deprecation\n IPoint,\n IPropsWithStyles,\n IRectangle,\n IRefObject,\n IRenderComponent,\n IRenderFunction,\n ISelection,\n ISelectionOptions,\n ISelectionOptionsWithRequiredGetKey,\n ISerializableObject,\n ISettings,\n ISettingsFunction,\n ISettingsMap,\n ISize,\n IStyleFunction,\n IStyleFunctionOrObject,\n IVirtualElement,\n IWarnControlledUsageParams,\n // eslint-disable-next-line deprecation/deprecation\n Omit,\n Point,\n RefObject,\n // eslint-disable-next-line deprecation/deprecation\n Settings,\n // eslint-disable-next-line deprecation/deprecation\n SettingsFunction,\n StyleFunction,\n} from '@fluentui/react/lib/Utilities';\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ILineChartDataPoint } from '../../types/IDataPoint';
|
|
3
|
+
import { ISparklineProps } from '../../index';
|
|
4
|
+
export interface ISparklineState {
|
|
5
|
+
_points: ILineChartDataPoint[] | null;
|
|
6
|
+
_width: number;
|
|
7
|
+
_height: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class SparklineBase extends React.Component<ISparklineProps, ISparklineState> {
|
|
10
|
+
private margin;
|
|
11
|
+
private x;
|
|
12
|
+
private y;
|
|
13
|
+
private area;
|
|
14
|
+
constructor(props: ISparklineProps);
|
|
15
|
+
componentDidMount(): void;
|
|
16
|
+
drawSparkline(): JSX.Element;
|
|
17
|
+
render(): JSX.Element;
|
|
18
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { scaleLinear as d3ScaleLinear } from 'd3-scale';
|
|
4
|
+
import { area as d3Area, curveMonotoneX as d3CurveMonotoneX } from 'd3-shape';
|
|
5
|
+
import { max as d3Max, extent as d3Extent } from 'd3-array';
|
|
6
|
+
import { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';
|
|
7
|
+
import { classNamesFunction } from '@fluentui/react/lib/Utilities';
|
|
8
|
+
var getClassNames = classNamesFunction();
|
|
9
|
+
var SparklineBase = /** @class */ (function (_super) {
|
|
10
|
+
__extends(SparklineBase, _super);
|
|
11
|
+
function SparklineBase(props) {
|
|
12
|
+
var _this = _super.call(this, props) || this;
|
|
13
|
+
_this.margin = {
|
|
14
|
+
top: 2,
|
|
15
|
+
right: 0,
|
|
16
|
+
bottom: 0,
|
|
17
|
+
left: 0,
|
|
18
|
+
};
|
|
19
|
+
_this.state = {
|
|
20
|
+
_points: null,
|
|
21
|
+
_width: _this.props.width || 80,
|
|
22
|
+
_height: _this.props.height || 20 + _this.margin.bottom + _this.margin.top,
|
|
23
|
+
};
|
|
24
|
+
return _this;
|
|
25
|
+
}
|
|
26
|
+
SparklineBase.prototype.componentDidMount = function () {
|
|
27
|
+
var _this = this;
|
|
28
|
+
var area = d3Area()
|
|
29
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
30
|
+
.x(function (d) { return _this.x(d.x); })
|
|
31
|
+
.y0(this.state._height)
|
|
32
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
33
|
+
.y1(function (d) { return _this.y(d.y); })
|
|
34
|
+
.curve(d3CurveMonotoneX);
|
|
35
|
+
this.area = area;
|
|
36
|
+
var points = this.props.data.lineChartData[0].data;
|
|
37
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
38
|
+
var _a = d3Extent(points, function (d) { return d.x; }), xMin = _a[0], xMax = _a[1];
|
|
39
|
+
this.x = d3ScaleLinear()
|
|
40
|
+
.domain([xMin, xMax])
|
|
41
|
+
.range([this.margin.left, this.state._width - this.margin.right]);
|
|
42
|
+
this.y = d3ScaleLinear()
|
|
43
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
44
|
+
.domain([0, d3Max(points, function (d) { return d.y; })])
|
|
45
|
+
.range([this.state._height - this.margin.bottom, this.margin.top]);
|
|
46
|
+
this.setState({
|
|
47
|
+
_points: points,
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
SparklineBase.prototype.drawSparkline = function () {
|
|
51
|
+
return (React.createElement("path", { className: "area", d: this.area(this.state._points), opacity: 1, fillOpacity: 0.2, fill: this.props.data.lineChartData[0].color, strokeWidth: 2, stroke: this.props.data.lineChartData[0].color, "aria-label": "Sparkline with label " + this.props.data.lineChartData[0].legend }));
|
|
52
|
+
};
|
|
53
|
+
SparklineBase.prototype.render = function () {
|
|
54
|
+
var classNames = getClassNames(this.props.styles, {
|
|
55
|
+
theme: this.props.theme,
|
|
56
|
+
});
|
|
57
|
+
return (React.createElement(FocusZone, { direction: FocusZoneDirection.horizontal, isCircularNavigation: true, className: classNames.inlineBlock },
|
|
58
|
+
React.createElement("div", { className: classNames.inlineBlock },
|
|
59
|
+
this.state._width >= 50 && this.state._height >= 16 ? (React.createElement("svg", { width: this.state._width, height: this.state._height, tabIndex: 0 }, this.state._points ? this.drawSparkline() : null)) : (React.createElement(React.Fragment, null)),
|
|
60
|
+
this.props.showLegend && this.props.data.lineChartData[0].legend ? (React.createElement("span", { role: "text", className: classNames.titleText, tabIndex: 0 }, this.props.data.lineChartData[0].legend)) : (React.createElement(React.Fragment, null)))));
|
|
61
|
+
};
|
|
62
|
+
return SparklineBase;
|
|
63
|
+
}(React.Component));
|
|
64
|
+
export { SparklineBase };
|
|
65
|
+
//# sourceMappingURL=Sparkline.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sparkline.base.js","sourceRoot":"../src/","sources":["components/Sparkline/Sparkline.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,cAAc,IAAI,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,SAAS,EA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nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { area as d3Area, curveMonotoneX as d3CurveMonotoneX } from 'd3-shape';\nimport { max as d3Max, extent as d3Extent } from 'd3-array';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { ILineChartDataPoint } from '../../types/IDataPoint';\nimport { classNamesFunction } from '@fluentui/react/lib/Utilities';\nimport { ISparklineProps, ISparklineStyleProps, ISparklineStyles } from '../../index';\nconst getClassNames = classNamesFunction<ISparklineStyleProps, ISparklineStyles>();\n\nexport interface ISparklineState {\n _points: ILineChartDataPoint[] | null;\n _width: number;\n _height: number;\n}\n\nexport class SparklineBase extends React.Component<ISparklineProps, ISparklineState> {\n private margin = {\n top: 2,\n right: 0,\n bottom: 0,\n left: 0,\n };\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n private x: any;\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n private y: any;\n private area: any;\n\n constructor(props: ISparklineProps) {\n super(props);\n this.state = {\n _points: null,\n _width: this.props.width! || 80,\n _height: this.props.height! || 20 + this.margin.bottom + this.margin.top,\n };\n }\n\n public componentDidMount() {\n const area = d3Area()\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .x((d: any) => this.x(d.x))\n .y0(this.state._height)\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .y1((d: any) => this.y(d.y))\n .curve(d3CurveMonotoneX);\n this.area = area;\n\n const points = this.props.data!.lineChartData![0].data;\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n const [xMin, xMax] = d3Extent(points, (d: any) => d.x);\n\n this.x = d3ScaleLinear()\n .domain([xMin, xMax])\n .range([this.margin.left!, this.state._width - this.margin.right!]);\n this.y = d3ScaleLinear()\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .domain([0, d3Max(points, (d: any) => d.y)])\n .range([this.state._height - this.margin.bottom!, this.margin.top!]);\n\n this.setState({\n _points: points,\n });\n }\n\n public drawSparkline() {\n return (\n <path\n className=\"area\"\n d={this.area(this.state._points)}\n opacity={1}\n fillOpacity={0.2}\n fill={this.props.data!.lineChartData![0].color!}\n strokeWidth={2}\n stroke={this.props.data!.lineChartData![0].color!}\n aria-label={`Sparkline with label ${this.props.data!.lineChartData![0].legend!}`}\n />\n );\n }\n\n public render() {\n const classNames = getClassNames(this.props.styles!, {\n theme: this.props.theme!,\n });\n return (\n <FocusZone\n direction={FocusZoneDirection.horizontal}\n isCircularNavigation={true}\n className={classNames.inlineBlock}\n >\n <div className={classNames.inlineBlock}>\n {this.state._width >= 50 && this.state._height >= 16 ? (\n <svg width={this.state._width} height={this.state._height} tabIndex={0}>\n {this.state._points ? this.drawSparkline() : null}\n </svg>\n ) : (\n <></>\n )}\n {this.props.showLegend && this.props.data!.lineChartData![0].legend ? (\n <span role=\"text\" className={classNames.titleText} tabIndex={0}>\n {this.props.data!.lineChartData![0].legend!}\n </span>\n ) : (\n <></>\n )}\n </div>\n </FocusZone>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { styled } from '@fluentui/react/lib/Utilities';
|
|
2
|
+
import { SparklineBase } from './Sparkline.base';
|
|
3
|
+
import { getStyles } from './Sparkline.styles';
|
|
4
|
+
// Create a Sparkline variant which uses these default styles and this styled subcomponent.
|
|
5
|
+
export var Sparkline = styled(SparklineBase, getStyles);
|
|
6
|
+
//# sourceMappingURL=Sparkline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sparkline.js","sourceRoot":"../src/","sources":["components/Sparkline/Sparkline.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,2FAA2F;AAC3F,MAAM,CAAC,IAAM,SAAS,GAA6C,MAAM,CAIvE,aAAa,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '@fluentui/react/lib/Utilities';\nimport { ISparklineStyles, ISparklineProps, ISparklineStyleProps } from '../../index';\nimport { SparklineBase } from './Sparkline.base';\nimport { getStyles } from './Sparkline.styles';\n\n// Create a Sparkline variant which uses these default styles and this styled subcomponent.\nexport const Sparkline: React.FunctionComponent<ISparklineProps> = styled<\n ISparklineProps,\n ISparklineStyleProps,\n ISparklineStyles\n>(SparklineBase, getStyles);\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
export var getStyles = function (props) {
|
|
3
|
+
return {
|
|
4
|
+
inlineBlock: {
|
|
5
|
+
display: 'inline',
|
|
6
|
+
},
|
|
7
|
+
titleText: __assign({ marginLeft: '8px', textAlign: 'center' }, props.theme.fonts.smallPlus),
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=Sparkline.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sparkline.styles.js","sourceRoot":"../src/","sources":["components/Sparkline/Sparkline.styles.ts"],"names":[],"mappings":";AAEA,MAAM,CAAC,IAAM,SAAS,GAAG,UAAC,KAA2B;IACnD,OAAO;QACL,WAAW,EAAE;YACX,OAAO,EAAE,QAAQ;SAClB;QACD,SAAS,aACP,UAAU,EAAE,KAAK,EACjB,SAAS,EAAE,QAAQ,IAChB,KAAK,CAAC,KAAM,CAAC,KAAK,CAAC,SAAS,CAChC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { ISparklineStyleProps, ISparklineStyles } from './Sparkline.types';\n\nexport const getStyles = (props: ISparklineStyleProps): ISparklineStyles => {\n return {\n inlineBlock: {\n display: 'inline',\n },\n titleText: {\n marginLeft: '8px',\n textAlign: 'center',\n ...props.theme!.fonts.smallPlus,\n },\n };\n};\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ITheme, IStyle } from '@fluentui/react/lib/Styling';
|
|
2
|
+
import { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';
|
|
3
|
+
import { IChartProps } from '../../types/IDataPoint';
|
|
4
|
+
import { ICartesianChartStyleProps } from '../CommonComponents/index';
|
|
5
|
+
export interface ISparklineStyleProps extends ICartesianChartStyleProps {
|
|
6
|
+
}
|
|
7
|
+
export interface ISparklineProps {
|
|
8
|
+
/**
|
|
9
|
+
* An array of chart data points for the Sparkline chart
|
|
10
|
+
*/
|
|
11
|
+
data?: IChartProps;
|
|
12
|
+
/**
|
|
13
|
+
* Width of chart
|
|
14
|
+
* * @default 80
|
|
15
|
+
*/
|
|
16
|
+
width?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Height of chart
|
|
19
|
+
* @default 20
|
|
20
|
+
*/
|
|
21
|
+
height?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Additional CSS class(es) to apply to the SparklineChart.
|
|
24
|
+
*/
|
|
25
|
+
className?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Theme (provided through customization.)
|
|
28
|
+
*/
|
|
29
|
+
theme?: ITheme;
|
|
30
|
+
/**
|
|
31
|
+
* The prop used to define the culture to localized the numbers
|
|
32
|
+
*/
|
|
33
|
+
culture?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Prop used to determine whether to show the legend or not
|
|
36
|
+
*/
|
|
37
|
+
showLegend?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Call to provide customized styling that will layer on top of the variant rules.
|
|
40
|
+
*/
|
|
41
|
+
styles?: IStyleFunctionOrObject<ISparklineStyleProps, ISparklineStyles>;
|
|
42
|
+
}
|
|
43
|
+
export interface ISparklineStyles {
|
|
44
|
+
inlineBlock?: IStyle;
|
|
45
|
+
titleText?: IStyle;
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sparkline.types.js","sourceRoot":"../src/","sources":["components/Sparkline/Sparkline.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IChartProps } from '../../types/IDataPoint';\nimport { ICartesianChartStyleProps } from '../CommonComponents/index';\n\nexport interface ISparklineStyleProps extends ICartesianChartStyleProps {}\n\nexport interface ISparklineProps {\n /**\n * An array of chart data points for the Sparkline chart\n */\n data?: IChartProps;\n\n /**\n * Width of chart\n * * @default 80\n */\n width?: number;\n\n /**\n * Height of chart\n * @default 20\n */\n height?: number;\n\n /**\n * Additional CSS class(es) to apply to the SparklineChart.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * Prop used to determine whether to show the legend or not\n */\n showLegend?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ISparklineStyleProps, ISparklineStyles>;\n}\n\nexport interface ISparklineStyles {\n inlineBlock?: IStyle;\n titleText?: IStyle;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Sparkline/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './Sparkline';\nexport * from './Sparkline.types';\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ITreeProps, ITreeState } from '../../index';
|
|
3
|
+
export declare class TreeChartBase extends React.Component<ITreeProps, ITreeState> {
|
|
4
|
+
private _treeData;
|
|
5
|
+
private _width;
|
|
6
|
+
private _height;
|
|
7
|
+
private _composition;
|
|
8
|
+
private _classNames;
|
|
9
|
+
private _rootElem;
|
|
10
|
+
private _margin;
|
|
11
|
+
private _nodeElements;
|
|
12
|
+
private _linkElements;
|
|
13
|
+
private _treeTraversal;
|
|
14
|
+
constructor(props: ITreeProps);
|
|
15
|
+
componentDidMount(): void;
|
|
16
|
+
createTreeChart(): void;
|
|
17
|
+
render(): JSX.Element;
|
|
18
|
+
}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { select } from 'd3-selection';
|
|
4
|
+
import { hierarchy, tree } from 'd3-hierarchy';
|
|
5
|
+
import { classNamesFunction } from '@fluentui/react/lib/Utilities';
|
|
6
|
+
import { FocusZone } from '@fluentui/react-focus';
|
|
7
|
+
var getClassNames = classNamesFunction();
|
|
8
|
+
// Create a parent class for common tree components
|
|
9
|
+
var StandardTree = /** @class */ (function () {
|
|
10
|
+
function StandardTree(treeData, styleClassNames, _nodeElements, _linkElements) {
|
|
11
|
+
if (_nodeElements === void 0) { _nodeElements = []; }
|
|
12
|
+
if (_linkElements === void 0) { _linkElements = []; }
|
|
13
|
+
this._nodeElements = [];
|
|
14
|
+
this._linkElements = [];
|
|
15
|
+
this.treeData = treeData;
|
|
16
|
+
this.styleClassNames = styleClassNames;
|
|
17
|
+
this._nodeElements = _nodeElements;
|
|
18
|
+
this._linkElements = _linkElements;
|
|
19
|
+
}
|
|
20
|
+
// Append node elements
|
|
21
|
+
// nodeId to create unique key
|
|
22
|
+
StandardTree.prototype.addNodeShapetoSVG = function (name, subname, metricName, xCoordinate, yCoordinate, fillColor, rectangleWidth, rectangleHeight, nodeId, parentInfo) {
|
|
23
|
+
var ariaLabel = "nodeId: " + nodeId + " \nnodeMainText: " + name + "\nsubText " + subname + " " + parentInfo;
|
|
24
|
+
this._nodeElements.push(React.createElement("rect", { width: rectangleWidth, height: rectangleHeight, x: xCoordinate, y: yCoordinate, tabIndex: 0, role: 'text', "data-is-focusable": true, "aria-label": ariaLabel, className: this.styleClassNames.rectNode, stroke: fillColor, key: "" + nodeId + this.styleClassNames.rectNode }));
|
|
25
|
+
// Text position y = y + rectHeight/2, 2 is ratio for depth
|
|
26
|
+
// Text position x = x + rectWidth/2, 2 is ratio for length
|
|
27
|
+
// Sub-text position x = x + rectWidth/2, 2 is ratio for length
|
|
28
|
+
var subValue = metricName !== undefined ? (React.createElement("tspan", { className: this.styleClassNames.rectmetricText, dy: "1.4em", x: xCoordinate + rectangleWidth / 2 }, metricName)) : (React.createElement("tspan", { className: this.styleClassNames.rectSubText, dy: "1.4em", x: xCoordinate + rectangleWidth / 2 }, subname));
|
|
29
|
+
this._nodeElements.push(React.createElement("text", { textAnchor: "middle", className: metricName !== undefined ? this.styleClassNames.rectSubText : this.styleClassNames.rectText, dy: metricName !== undefined ? yCoordinate + rectangleHeight / 2.5 : yCoordinate + rectangleHeight / 2, x: xCoordinate + rectangleWidth / 2, key: "" + nodeId + this.styleClassNames.rectText },
|
|
30
|
+
name,
|
|
31
|
+
subValue));
|
|
32
|
+
};
|
|
33
|
+
// Create a rectangular path from parent to the child nodes
|
|
34
|
+
StandardTree.prototype.createPathLink = function (parentX, parentY, childX, childY, leaf, rectWidth, rectHeight, gap) {
|
|
35
|
+
// gap adds ratio for parent.y to child.y
|
|
36
|
+
var path = "M" + (childX + rectWidth / 2) + "," + (childY - gap) + " H" + (parentX + rectWidth / 2) + " V" + (parentY + rectHeight + gap / 2);
|
|
37
|
+
var leafpath = "M" + (parentX + rectWidth / 2) + "," + (parentY + rectHeight + gap / 2) + " V" + (parentY + gap * 5) + " H" + parentX + " H" + (parentX + rectWidth);
|
|
38
|
+
// based on the type of node return leafpath or path element
|
|
39
|
+
return leaf ? leafpath : path;
|
|
40
|
+
};
|
|
41
|
+
// Append path link element
|
|
42
|
+
StandardTree.prototype.addLinktoSVG = function (nodeId, parentX, parentY, childX, childY, leaf, rectWidth, rectHeight, gap) {
|
|
43
|
+
this._linkElements.push(React.createElement("path", { className: this.styleClassNames.link, d: this.createPathLink(parentX, parentY, childX, childY, leaf, rectWidth, rectHeight, gap), key: "" + nodeId + this.styleClassNames.link }));
|
|
44
|
+
};
|
|
45
|
+
return StandardTree;
|
|
46
|
+
}());
|
|
47
|
+
// Create child class to Add Tree component based on treeHeight
|
|
48
|
+
var LayeredTree = /** @class */ (function (_super) {
|
|
49
|
+
__extends(LayeredTree, _super);
|
|
50
|
+
function LayeredTree(treeData, composition, styleClassNames, _nodeElements, _linkElements, _treeTraversal) {
|
|
51
|
+
if (_nodeElements === void 0) { _nodeElements = []; }
|
|
52
|
+
if (_linkElements === void 0) { _linkElements = []; }
|
|
53
|
+
var _this = _super.call(this, treeData, styleClassNames, _nodeElements, _linkElements) || this;
|
|
54
|
+
_this.composition = composition;
|
|
55
|
+
_this._treeTraversal = _treeTraversal;
|
|
56
|
+
return _this;
|
|
57
|
+
}
|
|
58
|
+
LayeredTree.prototype.createTree = function () {
|
|
59
|
+
var _a, _b, _c, _d;
|
|
60
|
+
var root = hierarchy(this.treeData, function (d) {
|
|
61
|
+
return d.children;
|
|
62
|
+
});
|
|
63
|
+
// Find tree Height
|
|
64
|
+
var treeHeight = (root === null || root === void 0 ? void 0 : root.height) + 1;
|
|
65
|
+
// Create tree layout, width: 70, height: 90 and add node separation
|
|
66
|
+
var treemap = tree()
|
|
67
|
+
.nodeSize([75, 50])
|
|
68
|
+
.separation(function (a, b) {
|
|
69
|
+
return a.parent === root && b.parent === root ? 3.5 : 1;
|
|
70
|
+
});
|
|
71
|
+
// Assigns the x and y position for the nodes
|
|
72
|
+
var treeData = treemap(root);
|
|
73
|
+
// Compute the new tree layout.
|
|
74
|
+
var nodes = treeData.descendants();
|
|
75
|
+
// Normalize for fixed-depth and width
|
|
76
|
+
// Normalise y coordinate by depth of each node by a factor of 130
|
|
77
|
+
// Normalise x coordinate by start coordinate 0 with 450
|
|
78
|
+
nodes.forEach(function (d) {
|
|
79
|
+
d.y = d.depth === 0 ? 10 : d.depth * 130;
|
|
80
|
+
d.x += 400;
|
|
81
|
+
});
|
|
82
|
+
// <------------------ Traversal section ------------------>
|
|
83
|
+
// Create tree data structure
|
|
84
|
+
var treeDataStructure = [];
|
|
85
|
+
var TreeID = 0;
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
87
|
+
var createTreeDataStructure = function (d) {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
d.id = TreeID;
|
|
90
|
+
treeDataStructure.push({
|
|
91
|
+
id: TreeID,
|
|
92
|
+
children: d.children,
|
|
93
|
+
dataName: d.data.name,
|
|
94
|
+
subName: d.data.subname,
|
|
95
|
+
metricName: (_a = d.data) === null || _a === void 0 ? void 0 : _a.metric,
|
|
96
|
+
fill: d.data.fill,
|
|
97
|
+
x: d.x,
|
|
98
|
+
y: d.y,
|
|
99
|
+
parentID: (_b = d.parent) === null || _b === void 0 ? void 0 : _b.id,
|
|
100
|
+
});
|
|
101
|
+
TreeID++;
|
|
102
|
+
};
|
|
103
|
+
this._treeTraversal === 0
|
|
104
|
+
? root.each(function (d) {
|
|
105
|
+
createTreeDataStructure(d);
|
|
106
|
+
})
|
|
107
|
+
: root.eachBefore(function (d) {
|
|
108
|
+
createTreeDataStructure(d);
|
|
109
|
+
});
|
|
110
|
+
var rectHeight = 70;
|
|
111
|
+
var rectWidth = 220;
|
|
112
|
+
var gap = 20;
|
|
113
|
+
var parentSet = new Set();
|
|
114
|
+
for (var _i = 0, treeDataStructure_1 = treeDataStructure; _i < treeDataStructure_1.length; _i++) {
|
|
115
|
+
var d = treeDataStructure_1[_i];
|
|
116
|
+
var parentInfo = d.id === 0
|
|
117
|
+
? 'Root Node'
|
|
118
|
+
: "Parent info parentId: " + d.parentID + "\n " + treeDataStructure[d.parentID].dataName + "\n " + treeDataStructure[d.parentID].subName;
|
|
119
|
+
// check for leaf nodes
|
|
120
|
+
if (!d.children && !parentSet.has(d.parentID) && treeHeight === 3) {
|
|
121
|
+
var newWidth = (rectWidth - gap) / 2;
|
|
122
|
+
var newHeight = 70;
|
|
123
|
+
parentSet.add(d.parentID);
|
|
124
|
+
// <------------------ Links section ------------------>
|
|
125
|
+
this.addLinktoSVG(d.id, treeDataStructure[d.parentID].x, treeDataStructure[d.parentID].y, treeDataStructure[d.id].x, treeDataStructure[d.id].y, true, rectWidth, rectHeight, gap);
|
|
126
|
+
// <------------------ Nodes section ------------------>
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
128
|
+
var children = (_a = treeDataStructure[d.parentID]) === null || _a === void 0 ? void 0 : _a.children;
|
|
129
|
+
var dx1 = (_b = treeDataStructure[d.parentID]) === null || _b === void 0 ? void 0 : _b.x;
|
|
130
|
+
var dx2 = ((_c = treeDataStructure[d.parentID]) === null || _c === void 0 ? void 0 : _c.x) + newWidth + gap;
|
|
131
|
+
var dy = (_d = children[0]) === null || _d === void 0 ? void 0 : _d.y;
|
|
132
|
+
for (var itr = 0; itr < children.length; ++itr) {
|
|
133
|
+
var child = children[itr];
|
|
134
|
+
// Given Composition
|
|
135
|
+
if (this.composition !== undefined) {
|
|
136
|
+
// For compact compostion
|
|
137
|
+
if (this.composition === 0) {
|
|
138
|
+
this.addNodeShapetoSVG(child.data.name, child.data.subname, child.data.metricName, itr % 2 === 0 ? dx1 : dx2, dy, child.data.fill, children.length === 1 ? rectWidth : newWidth, rectHeight, child.id, parentInfo);
|
|
139
|
+
if (itr % 2 === 1) {
|
|
140
|
+
dy += newHeight + gap;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// For long compostion
|
|
144
|
+
else {
|
|
145
|
+
this.addNodeShapetoSVG(child.data.name, child.data.subname, child.data.metricName, dx1, dy, child.data.fill, rectWidth, rectHeight, child.id, parentInfo);
|
|
146
|
+
dy += newHeight + gap;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// Automatic Node Composition
|
|
150
|
+
else {
|
|
151
|
+
if (children.length > 2) {
|
|
152
|
+
this.addNodeShapetoSVG(child.data.name, child.data.subname, child.data.metricName, itr % 2 === 0 ? dx1 : dx2, dy, child.data.fill, children.length === 1 ? rectWidth : newWidth, rectHeight, child.id, parentInfo);
|
|
153
|
+
if (itr % 2 === 1) {
|
|
154
|
+
dy += newHeight + gap;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
this.addNodeShapetoSVG(child.data.name, child.data.subname, child.data.metricName, dx1, dy, child.data.fill, rectWidth, rectHeight, child.id, parentInfo);
|
|
159
|
+
dy += newHeight + gap;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (d.children || treeHeight <= 2) {
|
|
165
|
+
// <------------------ Nodes section ------------------>
|
|
166
|
+
this.addNodeShapetoSVG(d.dataName, d.subName, d.metricName, d.x, d.y, d.fill, rectWidth, rectHeight, d.id, parentInfo);
|
|
167
|
+
// <------------------ Links section ------------------>
|
|
168
|
+
if (d.id !== 0) {
|
|
169
|
+
this.addLinktoSVG(d.id, treeDataStructure[d.parentID].x, treeDataStructure[d.parentID].y, treeDataStructure[d.id].x, treeDataStructure[d.id].y, false, rectWidth, rectHeight, gap);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
return LayeredTree;
|
|
175
|
+
}(StandardTree));
|
|
176
|
+
var TreeChartBase = /** @class */ (function (_super) {
|
|
177
|
+
__extends(TreeChartBase, _super);
|
|
178
|
+
function TreeChartBase(props) {
|
|
179
|
+
var _a;
|
|
180
|
+
var _this = _super.call(this, props) || this;
|
|
181
|
+
_this._nodeElements = [];
|
|
182
|
+
_this._linkElements = [];
|
|
183
|
+
_this._margin = { top: 30, right: 20, bottom: 30, left: 50 };
|
|
184
|
+
_this._width = _this.props.width || 1200;
|
|
185
|
+
_this._height = _this.props.height || 700;
|
|
186
|
+
_this._treeData = _this.props.treeData;
|
|
187
|
+
_this._composition = (_a = _this.props) === null || _a === void 0 ? void 0 : _a.composition;
|
|
188
|
+
_this._treeTraversal = _this.props.treeTraversal;
|
|
189
|
+
_this.state = {
|
|
190
|
+
_width: _this._width || 1000,
|
|
191
|
+
_height: _this._height || 700,
|
|
192
|
+
};
|
|
193
|
+
return _this;
|
|
194
|
+
}
|
|
195
|
+
TreeChartBase.prototype.componentDidMount = function () {
|
|
196
|
+
var _a = this.props, theme = _a.theme, className = _a.className, styles = _a.styles;
|
|
197
|
+
// Get classNames to create component styling
|
|
198
|
+
this._classNames = getClassNames(styles, {
|
|
199
|
+
theme: theme,
|
|
200
|
+
className: className,
|
|
201
|
+
});
|
|
202
|
+
// Call createTreeChart function in componentDidMount
|
|
203
|
+
this.createTreeChart();
|
|
204
|
+
var reducedHeight = this._rootElem && this._rootElem.offsetHeight / 5;
|
|
205
|
+
this.setState({
|
|
206
|
+
_width: (this._rootElem && this._rootElem.offsetWidth),
|
|
207
|
+
_height: (this._rootElem && this._rootElem.offsetHeight - reducedHeight),
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
TreeChartBase.prototype.createTreeChart = function () {
|
|
211
|
+
var svg = select('.svgTree');
|
|
212
|
+
// Set SVG width and height
|
|
213
|
+
svg
|
|
214
|
+
.attr('width', this.state._width - this._margin.left - this._margin.right)
|
|
215
|
+
.attr('height', this.state._height - this._margin.top - this._margin.bottom);
|
|
216
|
+
// Create styleClass object to access it in parent class
|
|
217
|
+
var styleClassNames = {
|
|
218
|
+
link: this._classNames.link,
|
|
219
|
+
rectNode: this._classNames.rectNode,
|
|
220
|
+
rectText: this._classNames.rectText,
|
|
221
|
+
rectSubText: this._classNames.rectSubText,
|
|
222
|
+
rectmetricText: this._classNames.rectMetricText,
|
|
223
|
+
};
|
|
224
|
+
// Instantiate inherited class and call createTree function for the object
|
|
225
|
+
var treeObject = new LayeredTree(this._treeData, this._composition, styleClassNames, this._nodeElements, this._linkElements, this._treeTraversal);
|
|
226
|
+
treeObject.createTree();
|
|
227
|
+
};
|
|
228
|
+
TreeChartBase.prototype.render = function () {
|
|
229
|
+
var _this = this;
|
|
230
|
+
return (React.createElement(FocusZone, null,
|
|
231
|
+
React.createElement("div", { className: "svgTreeDiv", ref: function (rootElem) { return (_this._rootElem = rootElem); } },
|
|
232
|
+
React.createElement("svg", { className: "svgTree" },
|
|
233
|
+
React.createElement("g", { className: "svgNode" }, this._nodeElements.map(function (element) { return element; })),
|
|
234
|
+
React.createElement("g", { className: "svgLink" }, this._linkElements.map(function (element) { return element; }))))));
|
|
235
|
+
};
|
|
236
|
+
return TreeChartBase;
|
|
237
|
+
}(React.Component));
|
|
238
|
+
export { TreeChartBase };
|
|
239
|
+
//# sourceMappingURL=TreeChart.base.js.map
|