semiotic 3.0.0-beta.4 → 3.0.0-beta.6
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/CLAUDE.md +81 -126
- package/README.md +6 -3
- package/ai/cli.js +72 -0
- package/dist/CategoryColors.d.ts +48 -0
- package/dist/ChartGrid.d.ts +37 -0
- package/dist/ContextLayout.d.ts +38 -0
- package/dist/charts/index.d.ts +2 -0
- package/dist/charts/shared/statisticalOverlays.d.ts +76 -0
- package/dist/charts/shared/types.d.ts +4 -0
- package/dist/charts/shared/validateChartData.d.ts +3 -0
- package/dist/charts/shared/withChartWrapper.d.ts +18 -0
- package/dist/charts/xy/AreaChart.d.ts +22 -1
- package/dist/charts/xy/ConnectedScatterplot.d.ts +60 -0
- package/dist/charts/xy/LineChart.d.ts +12 -0
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +8 -0
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +1 -0
- package/dist/semiotic.d.ts +9 -3
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/stream/DataSourceAdapter.d.ts +3 -0
- package/dist/stream/PipelineStore.d.ts +6 -0
- package/dist/stream/SceneGraph.d.ts +1 -1
- package/dist/stream/keyboardNav.d.ts +39 -0
- package/dist/stream/networkTypes.d.ts +2 -0
- package/dist/stream/ordinalTypes.d.ts +2 -0
- package/dist/stream/types.d.ts +24 -0
- package/dist/stream/useResponsiveSize.d.ts +10 -0
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +6 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,
|
|
1
|
+
"use strict";function e(e,t){const{groupBy:l,value:i,agg:o="sum"}=t,a=new Map;for(const t of e){const e=t[l]+"";a.has(e)||a.set(e,[]),a.get(e).push(Number(t[i]))}const n=[];for(const[e,t]of a){let i;switch(o){case"count":i=t.length;break;case"mean":i=t.reduce((e,t)=>e+t,0)/t.length;break;case"min":i=Math.min(...t);break;case"max":i=Math.max(...t);break;default:i=t.reduce((e,t)=>e+t,0)}n.push({[l]:e,value:i})}return n}function t(e){return Math.round(1e3*e)/1e3+""}function l(e){return"nominal"===e||"ordinal"===e}function i(e){return"quantitative"===e||"temporal"===e}"function"==typeof SuppressedError&&SuppressedError;const o={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},a={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},n={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"};function r(e,t,l,i,o){var a,n;(null==e?void 0:e.field)&&(l.xAccessor=i?"value":e.field),(null==t?void 0:t.field)&&(l.yAccessor=o?"value":t.field),(null===(a=null==e?void 0:e.axis)||void 0===a?void 0:a.title)&&(l.xLabel=e.axis.title),(null===(n=null==t?void 0:t.axis)||void 0===n?void 0:n.title)&&(l.yLabel=t.axis.title)}function s(e,t,l){const i={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(l.length>0){i.warnings=l;for(const e of l)console.warn("[semiotic/fromVegaLite] "+e)}return i}exports.bin=function(e,l){const{field:i,bins:o=10}=l,a=e.map(e=>Number(e[i])).filter(e=>!isNaN(e));if(0===a.length)return[];const n=l.domain?l.domain[0]:Math.min(...a),r=l.domain?l.domain[1]:Math.max(...a);if(n===r)return[{category:`${n}-${r}`,value:a.length}];const s=(r-n)/o,c=Array(o).fill(0);for(const e of a){let t=Math.floor((e-n)/s);t===o&&(t=o-1),t>=0&&o>t&&c[t]++}return c.map((e,l)=>{const i=n+l*s,o=i+s;return{category:`${t(i)}-${t(o)}`,value:e}})},exports.fromVegaLite=function(t){var c,d,u,v,f,p,g,y,m,b,h,x,k,A;const L=[],{type:w,markProps:O}=function(e){if("string"==typeof e)return{type:e,markProps:{}};const{type:t}=e;return{type:t,markProps:function(e,t){var l={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(l[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);i.length>o;o++)0>t.indexOf(i[o])&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(l[i[o]]=e[i[o]])}return l}(e,["type"])}}(t.mark),S=t.encoding||{},B=S.x,C=S.y,P=S.color,j=S.size,M=S.theta,R=S.opacity;let z;(null===(c=t.data)||void 0===c?void 0:c.values)?z=t.data.values:(null===(d=t.data)||void 0===d?void 0:d.url)&&L.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),t.transform&&t.transform.length>0&&L.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),t.layer&&L.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(t.hconcat||t.vconcat||t.concat)&&L.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(t.facet||t.encoding&&t.encoding.facet||t.encoding&&(t.encoding.row||t.encoding.column))&&L.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),t.repeat&&L.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(t.params||t.selection)&&L.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");const $={};t.width&&($.width=t.width),t.height&&($.height=t.height);const D=function(e){if(e)return"string"==typeof e?e:e.text}(t.title);if(D&&($.title=D),(null==P?void 0:P.field)&&($.colorBy=P.field,null===(u=P.scale)||void 0===u?void 0:u.scheme)){const e=o[P.scale.scheme];e&&($.colorScheme=e)}void 0!==(null==R?void 0:R.value)&&($.pointOpacity=R.value);const N=null==B?void 0:B.aggregate,V=null==C?void 0:C.aggregate;if(z&&(N||V)){const t=V?C:B,l=V?B:C,i=n[t.aggregate];if(i&&(null==l?void 0:l.field)&&t.field)z=e(z,{groupBy:l.field,value:t.field,agg:i});else if(("count"===i||"count"===t.aggregate)&&(null==l?void 0:l.field)&&z){const e=new Map;for(const t of z){const i=t[l.field]+"";e.set(i,(e.get(i)||0)+1)}z=Array.from(e,([e,t])=>({[l.field]:e,value:t}))}}if((null==B?void 0:B.bin)||(null==C?void 0:C.bin)){const e="Histogram";z&&($.data=z),(null==B?void 0:B.bin)?($.valueAccessor=B.field,(null==C?void 0:C.field)&&($.categoryAccessor=C.field),(null===(v=B.axis)||void 0===v?void 0:v.title)&&($.valueLabel=B.axis.title)):(null==C?void 0:C.bin)&&($.valueAccessor=C.field,(null==B?void 0:B.field)&&($.categoryAccessor=B.field),(null===(f=C.axis)||void 0===f?void 0:f.title)&&($.valueLabel=C.axis.title));const t="object"==typeof((null==B?void 0:B.bin)||(null==C?void 0:C.bin))?(null===(p=null==B?void 0:B.bin)||void 0===p?void 0:p.maxbins)||(null===(g=null==C?void 0:C.bin)||void 0===g?void 0:g.maxbins):void 0;return t&&($.bins=t),s(e,$,L)}let E;switch(w){case"bar":E=function(e,t,o,a,n,r,s){var c,d,u,v,f,p;let g;return(null==o?void 0:o.field)&&!1!==(null==e?void 0:e.stack)&&!1!==(null==t?void 0:t.stack)&&null!==(null==e?void 0:e.stack)&&null!==(null==t?void 0:t.stack)?(g="StackedBarChart",a.stackBy=o.field):g="BarChart",l(null==e?void 0:e.type)&&i(null==t?void 0:t.type)?(a.categoryAccessor=e.field,a.valueAccessor=s?"value":t.field,(null===(c=null==e?void 0:e.axis)||void 0===c?void 0:c.title)&&(a.categoryLabel=e.axis.title),(null===(d=null==t?void 0:t.axis)||void 0===d?void 0:d.title)&&(a.valueLabel=t.axis.title)):i(null==e?void 0:e.type)&&l(null==t?void 0:t.type)?(a.categoryAccessor=t.field,a.valueAccessor=r?"value":e.field,a.orientation="horizontal",(null===(u=null==t?void 0:t.axis)||void 0===u?void 0:u.title)&&(a.categoryLabel=t.axis.title),(null===(v=null==e?void 0:e.axis)||void 0===v?void 0:v.title)&&(a.valueLabel=e.axis.title)):((null==e?void 0:e.field)&&(a.categoryAccessor=e.field),(null==t?void 0:t.field)&&(a.valueAccessor=s?"value":t.field),(null===(f=null==e?void 0:e.axis)||void 0===f?void 0:f.title)&&(a.categoryLabel=e.axis.title),(null===(p=null==t?void 0:t.axis)||void 0===p?void 0:p.title)&&(a.valueLabel=t.axis.title)),n&&(a.data=n),g}(B,C,P,$,z,N,V);break;case"line":if(E="LineChart",r(B,C,$,N,V),(null==P?void 0:P.field)&&($.lineBy=P.field),O.interpolate){const e=a[O.interpolate];e&&($.curve=e)}!0===O.point&&($.showPoints=!0),z&&($.data=z);break;case"area":if((null==P?void 0:P.field)?(E="StackedAreaChart",$.areaBy=P.field):E="AreaChart",r(B,C,$,N,V),O.interpolate){const e=a[O.interpolate];e&&($.curve=e)}void 0!==O.opacity&&($.areaOpacity=O.opacity),z&&($.data=z);break;case"point":case"circle":case"square":(null==j?void 0:j.field)?(E="BubbleChart",$.sizeBy=j.field,(null===(y=j.scale)||void 0===y?void 0:y.range)&&($.sizeRange=j.scale.range)):E="Scatterplot",r(B,C,$,N,V),z&&($.data=z);break;case"rect":E="Heatmap",(null==B?void 0:B.field)&&($.xAccessor=B.field),(null==C?void 0:C.field)&&($.yAccessor=C.field),(null==P?void 0:P.field)&&($.valueAccessor=P.field,delete $.colorBy),(null===(m=null==B?void 0:B.axis)||void 0===m?void 0:m.title)&&($.xLabel=B.axis.title),(null===(b=null==C?void 0:C.axis)||void 0===b?void 0:b.title)&&($.yLabel=C.axis.title),z&&($.data=z);break;case"arc":O.innerRadius&&O.innerRadius>0?(E="DonutChart",$.innerRadius=O.innerRadius):E="PieChart",(null==M?void 0:M.field)?$.valueAccessor=M.field:(null==C?void 0:C.field)&&($.valueAccessor=V?"value":C.field),(null==P?void 0:P.field)&&($.categoryAccessor=P.field),(null==B?void 0:B.field)&&!(null==M?void 0:M.field)&&($.categoryAccessor=B.field),z&&($.data=z);break;case"tick":E="DotPlot",l(null==B?void 0:B.type)?($.categoryAccessor=B.field,(null==C?void 0:C.field)&&($.valueAccessor=V?"value":C.field),(null===(h=null==B?void 0:B.axis)||void 0===h?void 0:h.title)&&($.categoryLabel=B.axis.title),(null===(x=null==C?void 0:C.axis)||void 0===x?void 0:x.title)&&($.valueLabel=C.axis.title)):l(null==C?void 0:C.type)?($.categoryAccessor=C.field,(null==B?void 0:B.field)&&($.valueAccessor=N?"value":B.field),$.orientation="horizontal",(null===(k=null==C?void 0:C.axis)||void 0===k?void 0:k.title)&&($.categoryLabel=C.axis.title),(null===(A=null==B?void 0:B.axis)||void 0===A?void 0:A.title)&&($.valueLabel=B.axis.title)):((null==B?void 0:B.field)&&($.categoryAccessor=B.field),(null==C?void 0:C.field)&&($.valueAccessor=V?"value":C.field)),z&&($.data=z);break;default:L.push(`Unsupported mark type "${w}". Defaulting to Scatterplot.`),E="Scatterplot",r(B,C,$,N,V),z&&($.data=z)}return s(E,$,L)},exports.groupBy=function(e,t){const{key:l,fields:i}=t,o=new Map;for(const t of e){const e=t[l]+"";if(o.has(e)||o.set(e,[]),i){const l={};for(const e of i)e in t&&(l[e]=t[e]);o.get(e).push(l)}else o.get(e).push(Object.assign({},t))}const a=[];for(const[e,t]of o)a.push({id:e,coordinates:t});return a},exports.pivot=function(e,t){const{columns:l,nameField:i="name",valueField:o="value"}=t,a=new Set(l),n=[];for(const t of e){const e={};for(const l of Object.keys(t))a.has(l)||(e[l]=t[l]);for(const a of l)n.push(Object.assign(Object.assign({},e),{[i]:a,[o]:t[a]}))}return n},exports.rollup=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,
|
|
1
|
+
function e(e,t){const{field:l,bins:i=10}=t,a=e.map(e=>Number(e[l])).filter(e=>!isNaN(e));if(0===a.length)return[];const n=t.domain?t.domain[0]:Math.min(...a),r=t.domain?t.domain[1]:Math.max(...a);if(n===r)return[{category:`${n}-${r}`,value:a.length}];const s=(r-n)/i,c=Array(i).fill(0);for(const e of a){let t=Math.floor((e-n)/s);t===i&&(t=i-1),t>=0&&i>t&&c[t]++}return c.map((e,t)=>{const l=n+t*s,i=l+s;return{category:`${o(l)}-${o(i)}`,value:e}})}function t(e,t){const{groupBy:l,value:i,agg:o="sum"}=t,a=new Map;for(const t of e){const e=t[l]+"";a.has(e)||a.set(e,[]),a.get(e).push(Number(t[i]))}const n=[];for(const[e,t]of a){let i;switch(o){case"count":i=t.length;break;case"mean":i=t.reduce((e,t)=>e+t,0)/t.length;break;case"min":i=Math.min(...t);break;case"max":i=Math.max(...t);break;default:i=t.reduce((e,t)=>e+t,0)}n.push({[l]:e,value:i})}return n}function l(e,t){const{key:l,fields:i}=t,o=new Map;for(const t of e){const e=t[l]+"";if(o.has(e)||o.set(e,[]),i){const l={};for(const e of i)e in t&&(l[e]=t[e]);o.get(e).push(l)}else o.get(e).push(Object.assign({},t))}const a=[];for(const[e,t]of o)a.push({id:e,coordinates:t});return a}function i(e,t){const{columns:l,nameField:i="name",valueField:o="value"}=t,a=new Set(l),n=[];for(const t of e){const e={};for(const l of Object.keys(t))a.has(l)||(e[l]=t[l]);for(const a of l)n.push(Object.assign(Object.assign({},e),{[i]:a,[o]:t[a]}))}return n}function o(e){return Math.round(1e3*e)/1e3+""}function a(e){return"nominal"===e||"ordinal"===e}function n(e){return"quantitative"===e||"temporal"===e}"function"==typeof SuppressedError&&SuppressedError;const r={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},s={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},c={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"};function d(e){var l,i,o,d,f,p,y,g,m,b,h,x,k,A;const L=[],{type:w,markProps:O}=function(e){if("string"==typeof e)return{type:e,markProps:{}};const{type:t}=e;return{type:t,markProps:function(e,t){var l={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(l[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);i.length>o;o++)0>t.indexOf(i[o])&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(l[i[o]]=e[i[o]])}return l}(e,["type"])}}(e.mark),S=e.encoding||{},B=S.x,C=S.y,P=S.color,j=S.size,M=S.theta,R=S.opacity;let z;(null===(l=e.data)||void 0===l?void 0:l.values)?z=e.data.values:(null===(i=e.data)||void 0===i?void 0:i.url)&&L.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&L.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&L.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&L.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||e.encoding&&e.encoding.facet||e.encoding&&(e.encoding.row||e.encoding.column))&&L.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&L.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&L.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");const $={};e.width&&($.width=e.width),e.height&&($.height=e.height);const D=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(D&&($.title=D),(null==P?void 0:P.field)&&($.colorBy=P.field,null===(o=P.scale)||void 0===o?void 0:o.scheme)){const e=r[P.scale.scheme];e&&($.colorScheme=e)}void 0!==(null==R?void 0:R.value)&&($.pointOpacity=R.value);const N=null==B?void 0:B.aggregate,E=null==C?void 0:C.aggregate;if(z&&(N||E)){const e=E?C:B,l=E?B:C,i=c[e.aggregate];if(i&&(null==l?void 0:l.field)&&e.field)z=t(z,{groupBy:l.field,value:e.field,agg:i});else if(("count"===i||"count"===e.aggregate)&&(null==l?void 0:l.field)&&z){const e=new Map;for(const t of z){const i=t[l.field]+"";e.set(i,(e.get(i)||0)+1)}z=Array.from(e,([e,t])=>({[l.field]:e,value:t}))}}if((null==B?void 0:B.bin)||(null==C?void 0:C.bin)){const e="Histogram";z&&($.data=z),(null==B?void 0:B.bin)?($.valueAccessor=B.field,(null==C?void 0:C.field)&&($.categoryAccessor=C.field),(null===(d=B.axis)||void 0===d?void 0:d.title)&&($.valueLabel=B.axis.title)):(null==C?void 0:C.bin)&&($.valueAccessor=C.field,(null==B?void 0:B.field)&&($.categoryAccessor=B.field),(null===(f=C.axis)||void 0===f?void 0:f.title)&&($.valueLabel=C.axis.title));const t="object"==typeof((null==B?void 0:B.bin)||(null==C?void 0:C.bin))?(null===(p=null==B?void 0:B.bin)||void 0===p?void 0:p.maxbins)||(null===(y=null==C?void 0:C.bin)||void 0===y?void 0:y.maxbins):void 0;return t&&($.bins=t),v(e,$,L)}let F;switch(w){case"bar":F=function(e,t,l,i,o,r,s){var c,d,u,v,f,p;let y;return(null==l?void 0:l.field)&&!1!==(null==e?void 0:e.stack)&&!1!==(null==t?void 0:t.stack)&&null!==(null==e?void 0:e.stack)&&null!==(null==t?void 0:t.stack)?(y="StackedBarChart",i.stackBy=l.field):y="BarChart",a(null==e?void 0:e.type)&&n(null==t?void 0:t.type)?(i.categoryAccessor=e.field,i.valueAccessor=s?"value":t.field,(null===(c=null==e?void 0:e.axis)||void 0===c?void 0:c.title)&&(i.categoryLabel=e.axis.title),(null===(d=null==t?void 0:t.axis)||void 0===d?void 0:d.title)&&(i.valueLabel=t.axis.title)):n(null==e?void 0:e.type)&&a(null==t?void 0:t.type)?(i.categoryAccessor=t.field,i.valueAccessor=r?"value":e.field,i.orientation="horizontal",(null===(u=null==t?void 0:t.axis)||void 0===u?void 0:u.title)&&(i.categoryLabel=t.axis.title),(null===(v=null==e?void 0:e.axis)||void 0===v?void 0:v.title)&&(i.valueLabel=e.axis.title)):((null==e?void 0:e.field)&&(i.categoryAccessor=e.field),(null==t?void 0:t.field)&&(i.valueAccessor=s?"value":t.field),(null===(f=null==e?void 0:e.axis)||void 0===f?void 0:f.title)&&(i.categoryLabel=e.axis.title),(null===(p=null==t?void 0:t.axis)||void 0===p?void 0:p.title)&&(i.valueLabel=t.axis.title)),o&&(i.data=o),y}(B,C,P,$,z,N,E);break;case"line":if(F="LineChart",u(B,C,$,N,E),(null==P?void 0:P.field)&&($.lineBy=P.field),O.interpolate){const e=s[O.interpolate];e&&($.curve=e)}!0===O.point&&($.showPoints=!0),z&&($.data=z);break;case"area":if((null==P?void 0:P.field)?(F="StackedAreaChart",$.areaBy=P.field):F="AreaChart",u(B,C,$,N,E),O.interpolate){const e=s[O.interpolate];e&&($.curve=e)}void 0!==O.opacity&&($.areaOpacity=O.opacity),z&&($.data=z);break;case"point":case"circle":case"square":(null==j?void 0:j.field)?(F="BubbleChart",$.sizeBy=j.field,(null===(g=j.scale)||void 0===g?void 0:g.range)&&($.sizeRange=j.scale.range)):F="Scatterplot",u(B,C,$,N,E),z&&($.data=z);break;case"rect":F="Heatmap",(null==B?void 0:B.field)&&($.xAccessor=B.field),(null==C?void 0:C.field)&&($.yAccessor=C.field),(null==P?void 0:P.field)&&($.valueAccessor=P.field,delete $.colorBy),(null===(m=null==B?void 0:B.axis)||void 0===m?void 0:m.title)&&($.xLabel=B.axis.title),(null===(b=null==C?void 0:C.axis)||void 0===b?void 0:b.title)&&($.yLabel=C.axis.title),z&&($.data=z);break;case"arc":O.innerRadius&&O.innerRadius>0?(F="DonutChart",$.innerRadius=O.innerRadius):F="PieChart",(null==M?void 0:M.field)?$.valueAccessor=M.field:(null==C?void 0:C.field)&&($.valueAccessor=E?"value":C.field),(null==P?void 0:P.field)&&($.categoryAccessor=P.field),(null==B?void 0:B.field)&&!(null==M?void 0:M.field)&&($.categoryAccessor=B.field),z&&($.data=z);break;case"tick":F="DotPlot",a(null==B?void 0:B.type)?($.categoryAccessor=B.field,(null==C?void 0:C.field)&&($.valueAccessor=E?"value":C.field),(null===(h=null==B?void 0:B.axis)||void 0===h?void 0:h.title)&&($.categoryLabel=B.axis.title),(null===(x=null==C?void 0:C.axis)||void 0===x?void 0:x.title)&&($.valueLabel=C.axis.title)):a(null==C?void 0:C.type)?($.categoryAccessor=C.field,(null==B?void 0:B.field)&&($.valueAccessor=N?"value":B.field),$.orientation="horizontal",(null===(k=null==C?void 0:C.axis)||void 0===k?void 0:k.title)&&($.categoryLabel=C.axis.title),(null===(A=null==B?void 0:B.axis)||void 0===A?void 0:A.title)&&($.valueLabel=B.axis.title)):((null==B?void 0:B.field)&&($.categoryAccessor=B.field),(null==C?void 0:C.field)&&($.valueAccessor=E?"value":C.field)),z&&($.data=z);break;default:L.push(`Unsupported mark type "${w}". Defaulting to Scatterplot.`),F="Scatterplot",u(B,C,$,N,E),z&&($.data=z)}return v(F,$,L)}function u(e,t,l,i,o){var a,n;(null==e?void 0:e.field)&&(l.xAccessor=i?"value":e.field),(null==t?void 0:t.field)&&(l.yAccessor=o?"value":t.field),(null===(a=null==e?void 0:e.axis)||void 0===a?void 0:a.title)&&(l.xLabel=e.axis.title),(null===(n=null==t?void 0:t.axis)||void 0===n?void 0:n.title)&&(l.yLabel=t.axis.title)}function v(e,t,l){const i={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(l.length>0){i.warnings=l;for(const e of l)console.warn("[semiotic/fromVegaLite] "+e)}return i}export{e as bin,d as fromVegaLite,l as groupBy,i as pivot,t as rollup};
|
package/dist/semiotic-xy.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { LineChart } from "./charts/xy/LineChart";
|
|
|
8
8
|
export { AreaChart } from "./charts/xy/AreaChart";
|
|
9
9
|
export { StackedAreaChart } from "./charts/xy/StackedAreaChart";
|
|
10
10
|
export { Scatterplot } from "./charts/xy/Scatterplot";
|
|
11
|
+
export { ConnectedScatterplot } from "./charts/xy/ConnectedScatterplot";
|
|
11
12
|
export { BubbleChart } from "./charts/xy/BubbleChart";
|
|
12
13
|
export { Heatmap } from "./charts/xy/Heatmap";
|
|
13
14
|
export { ScatterplotMatrix } from "./charts/xy/ScatterplotMatrix";
|
package/dist/semiotic.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import StreamXYFrame from "./stream/StreamXYFrame";
|
|
2
2
|
import StreamOrdinalFrame from "./stream/StreamOrdinalFrame";
|
|
3
3
|
import StreamNetworkFrame from "./stream/StreamNetworkFrame";
|
|
4
|
-
import { Scatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, PieChart, DonutChart, GroupedBarChart, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, Treemap, CirclePack, ScatterplotMatrix, MinimapChart } from "./charts";
|
|
4
|
+
import { Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, PieChart, DonutChart, GroupedBarChart, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, Treemap, CirclePack, ScatterplotMatrix, MinimapChart } from "./charts";
|
|
5
5
|
import { LinkedCharts } from "./LinkedCharts";
|
|
6
6
|
import { ThemeProvider, useTheme } from "./ThemeProvider";
|
|
7
7
|
import { exportChart } from "./export/exportChart";
|
|
@@ -10,6 +10,9 @@ import { serializeSelections, deserializeSelections } from "./export/selectionSe
|
|
|
10
10
|
import { fromVegaLite } from "./data/fromVegaLite";
|
|
11
11
|
import { ChartErrorBoundary } from "./ChartErrorBoundary";
|
|
12
12
|
import { ChartContainer } from "./ChartContainer";
|
|
13
|
+
import { ChartGrid } from "./ChartGrid";
|
|
14
|
+
import { CategoryColorProvider, useCategoryColors } from "./CategoryColors";
|
|
15
|
+
import { ContextLayout } from "./ContextLayout";
|
|
13
16
|
import { DetailsPanel } from "./DetailsPanel";
|
|
14
17
|
import { Tooltip, MultiLineTooltip, normalizeTooltip } from "./Tooltip/Tooltip";
|
|
15
18
|
import { RingBuffer } from "./realtime/RingBuffer";
|
|
@@ -19,8 +22,8 @@ import { RealtimeTemporalHistogram, RealtimeHistogram } from "./charts/realtime/
|
|
|
19
22
|
import { RealtimeSwarmChart } from "./charts/realtime/RealtimeSwarmChart";
|
|
20
23
|
import { RealtimeWaterfallChart } from "./charts/realtime/RealtimeWaterfallChart";
|
|
21
24
|
import { RealtimeHeatmap } from "./charts/realtime/RealtimeHeatmap";
|
|
22
|
-
export { StreamXYFrame, StreamOrdinalFrame, StreamNetworkFrame, Scatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, PieChart, DonutChart, GroupedBarChart, Treemap, CirclePack, ScatterplotMatrix, MinimapChart, LinkedCharts, ThemeProvider, useTheme, exportChart, toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX, serializeSelections, deserializeSelections, fromVegaLite, ChartErrorBoundary, ChartContainer, DetailsPanel, Tooltip, MultiLineTooltip, normalizeTooltip, RingBuffer, IncrementalExtent, RealtimeLineChart, RealtimeTemporalHistogram, RealtimeHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap };
|
|
23
|
-
export { ScatterplotProps, LineChartProps, AreaChartProps, StackedAreaChartProps, HeatmapProps, BubbleChartProps, BarChartProps, StackedBarChartProps, SwarmPlotProps, BoxPlotProps, HistogramProps, ViolinPlotProps, DotPlotProps, PieChartProps, DonutChartProps, GroupedBarChartProps, ForceDirectedGraphProps, ChordDiagramProps, SankeyDiagramProps, TreeDiagramProps, TreemapProps, CirclePackProps, ScatterplotMatrixProps, MinimapChartProps, MinimapConfig, BaseChartProps, AxisConfig, Accessor, ChartAccessor, ChartMode } from "./charts";
|
|
25
|
+
export { StreamXYFrame, StreamOrdinalFrame, StreamNetworkFrame, Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, PieChart, DonutChart, GroupedBarChart, Treemap, CirclePack, ScatterplotMatrix, MinimapChart, LinkedCharts, ThemeProvider, useTheme, exportChart, toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX, serializeSelections, deserializeSelections, fromVegaLite, ChartErrorBoundary, ChartContainer, ChartGrid, CategoryColorProvider, useCategoryColors, ContextLayout, DetailsPanel, Tooltip, MultiLineTooltip, normalizeTooltip, RingBuffer, IncrementalExtent, RealtimeLineChart, RealtimeTemporalHistogram, RealtimeHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap };
|
|
26
|
+
export { ScatterplotProps, ConnectedScatterplotProps, LineChartProps, AreaChartProps, StackedAreaChartProps, HeatmapProps, BubbleChartProps, BarChartProps, StackedBarChartProps, SwarmPlotProps, BoxPlotProps, HistogramProps, ViolinPlotProps, DotPlotProps, PieChartProps, DonutChartProps, GroupedBarChartProps, ForceDirectedGraphProps, ChordDiagramProps, SankeyDiagramProps, TreeDiagramProps, TreemapProps, CirclePackProps, ScatterplotMatrixProps, MinimapChartProps, MinimapConfig, BaseChartProps, AxisConfig, Accessor, ChartAccessor, ChartMode } from "./charts";
|
|
24
27
|
export type { StreamXYFrameProps, StreamXYFrameHandle, StreamChartType, RuntimeMode, SceneNode, Changeset, StreamScales, StreamLayout, CurveType, CanvasRendererFn } from "./stream/types";
|
|
25
28
|
export type { StreamRendererFn } from "./stream/renderers/types";
|
|
26
29
|
export type { StreamOrdinalFrameProps, StreamOrdinalFrameHandle, OrdinalChartType, OrdinalScales, OrdinalSceneNode } from "./stream/ordinalTypes";
|
|
@@ -37,6 +40,9 @@ export type { SemioticTheme } from "./ThemeProvider";
|
|
|
37
40
|
export { LIGHT_THEME, DARK_THEME } from "./ThemeProvider";
|
|
38
41
|
export type { ChartErrorBoundaryProps } from "./ChartErrorBoundary";
|
|
39
42
|
export type { ChartContainerProps, ChartContainerHandle } from "./ChartContainer";
|
|
43
|
+
export type { ChartGridProps } from "./ChartGrid";
|
|
44
|
+
export type { CategoryColorMap, CategoryColorProviderProps } from "./CategoryColors";
|
|
45
|
+
export type { ContextLayoutProps } from "./ContextLayout";
|
|
40
46
|
export type { DetailsPanelProps } from "./DetailsPanel";
|
|
41
47
|
export type { ChartConfig, ToConfigOptions, CopyFormat } from "./export/chartConfig";
|
|
42
48
|
export type { VegaLiteSpec, VegaLiteEncoding } from "./data/fromVegaLite";
|