### Start Development Server Source: https://github.com/ajaxy/telegram-tt/blob/master/README.md Starts the development server for the project. This command is used for local development and testing. ```sh npm run dev ``` -------------------------------- ### Toolup Setup Shorthand Notations Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Illustrates various shorthand notations that can be used instead of a canonical setup object. These shorthands expand into objects with a 'content' property, simplifying view definitions. ```js 'name' ``` ```js { view: 'name' } ``` ```js ['view', { view: 'name' }] ``` -------------------------------- ### Chart.js Initialization Example Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Example of initializing a Chart.js chart with a canvas element and default configuration. ```javascript var ra={type:"line",data:{datasets:[]}};function oa(e){e.view.define("chart-chart-js",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ra,i=document.createElement("canvas");e.appendChild(i),e.classList.add(Xo.Z.root),setTimeout((function(){return new Ko ``` -------------------------------- ### Install Dependencies Source: https://github.com/ajaxy/telegram-tt/blob/master/README.md Installs project dependencies using npm. Ensure you have Node.js and npm installed. ```sh mv .env.example .env npm i ``` -------------------------------- ### Statoscope Default Examples Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html An array of default examples for Statoscope views, including Table, Auto-link list, and Signature. ```javascript var ko=[ {name:"Table",content:tr({view:"table"})}, {name:"Auto-link list",content:tr({view:"ol",item:"auto-link"})}, {name:"Signature",content:tr({view:"signature",expanded:2})} ]; ``` -------------------------------- ### Fetch Users API Example Source: https://github.com/ajaxy/telegram-tt/blob/master/CLAUDE.md Example of fetching user data using the GramJS API. It maps ApiUser objects to input user format, invokes the API, and converts the results back to ApiUser objects. ```typescript // src/api/gramjs/methods/users.ts export async function fetchUsers({ users }: { users: ApiUser[] }) { const result = await invokeRequest(new GramJs.users.GetUsers({ id: users.map(({ id, accessHash }) => buildInputUser(id, accessHash)), })); if (!result || !result.length) { return undefined; } const apiUsers = result.map(buildApiUser).filter(Boolean); const userStatusesById = buildApiUserStatuses(result); return { users: apiUsers, userStatusesById, }; } ``` -------------------------------- ### Tab Component Examples Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Demonstrates different configurations for the tab component, including active/disabled states and click handlers. ```javascript {title:"Active & disabled tab",demo:{view:"tabs",name:"tabs",tabs:[{value:"one",text:"One"},{value:"two",text:"Two",active:!0},{value:"three",text:"Three",disabled:!0}],content:{view:"switch",content:[{when:'#.tabs="one"',content:'text:"One"'},{when:'#.tabs="two"',content:'text:"Two"'},{when:'#.tabs="three"',content:'text:"Three"'}]}}},{title:"On click handler",demo:{view:"tabs",name:"tabs",tabs:[{value:"one",text:"One",onClick:We},{value:"two",text:"Two",onClick:We},{value:"three",text:"Three",onClick:We}],content:{view:"switch",content:[{when:'#.tabs="one"',content:'text:"One"'},{when:'#.tabs="two"',content:'text:"Two"'},{when:'#.tabs="three"',content:'text:"Three"'}]}}} ``` -------------------------------- ### Get Initial Assets for an Entrypoint Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Retrieves files (assets) from chunks that are marked as 'initial' for a given entrypoint. ```javascript t.query("(data.chunks + data.chunks..children).[initial].files",e) ``` -------------------------------- ### Toggle Group Component Examples Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Demonstrates configurations for the toggle group component, including before/after content and on-change handlers. ```javascript {title:"With before and after content",demo:{view:"toggle-group",data:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}],beforeToggles:'text:""',afterToggles:'text:""'}},{title:"On change handler",demo:{view:"toggle-group",name:"example",onChange:new Function('return (value) => alert("changed to " + value)')(),data:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}]}} ``` -------------------------------- ### Start Inspection Action (JavaScript) Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Defines the 'startInspect' action to begin the inspection process. ```javascript e.action.define("startInspect",g) ``` -------------------------------- ### Get Async Assets for an Entrypoint Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Retrieves files (assets) from chunks that are not marked as 'initial' for a given entrypoint. ```javascript t.query("(data.chunks + data.chunks..children).[not initial].files",e) ``` -------------------------------- ### Setup Upload Functionality Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Defines and sets up the 'upload' preset, which includes a primary button for file uploads and associated actions. ```javascript setup:vd, md=e=>/^\./.test(e); function vd(e){ return e=e||!0, function(t){ let n=e.accept?String(e.accept):"application/json,application/jsonxl,.json,.jsonxl",i=Boolean(e.dragdrop||void 0===e.dragdrop), r=n.split(","); i&& (t.dom.container.addEventListener("drop",((e=>{t.loadDataFromEvent(e)})),!0), t.dom.container.addEventListener("dragover",((e=>{e.stopPropagation(),e.preventDefault()})),!0)), t.preset.define("upload",[{ view:"button-primary", onClick:"=#.actions.uploadFile", content:'text:`Open file ${#.actions.uploadFile.fileExtensions | $` }]) } } ``` -------------------------------- ### Markdown View with Basic Source Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Renders markdown content. This example shows a basic markdown string as the source. ```javascript { view: "markdown", source: "# Markdown example\n\n> NOTE: The \`markdown\` view is based on [marked](https://github.com/markedjs/marked) package\n\nMarkdown is good because:\n* You\'ll get \*\*formatted\*\* \*text\* with \_no tags_\n* It\'s much simpler than \`HTML\`\n\n\`\`\`html\nbolditalic\n\`\`\`\n[Read more](https://guides.github.com/features/mastering-markdown/)" } ``` -------------------------------- ### Migrate Component Signature Source: https://github.com/ajaxy/telegram-tt/blob/master/CLAUDE.md Example demonstrating the migration from the older FC syntax to the new functional component signature in TypeScript. ```typescript // Before const OldComp: FC = ({ … }) => { … } // After const NewComp = (props: OwnProps & StateProps) => { … } ``` -------------------------------- ### Get All Assets for an Entrypoint Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Retrieves all files (assets) associated with an entrypoint's chunks, including nested children. ```javascript t.query("(data.chunks + data.chunks..children).files",e) ``` -------------------------------- ### Handle Property Access or Call Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Handles property access or the start of a function call, transitioning to 'q' or '$e' state respectively. ```javascript function ae(e){return":"==e?T(q):"("==e?S($e):void 0} ``` -------------------------------- ### Badge Variations Example Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Shows different variations of the badge component, including a list of titles and a custom-colored badge. ```javascript var rn=(e,t)=>({demo:{view:e,data:JSON.stringify(e)},examples:[{title:"Variations",demo:t.map((e=>` ${e}:"${e}" `))},{title:"Custom colors",beforeDemo:{view:"md",source:["Data properties to setup a custom colors:","* `color` – default background color","* `textColor` – default text color","* `darkColor` – background color in dark mode","* `textColor` – text color in dark mode"].join("\n")},demo:{view:e,data:{text:"Colored badge",color:"rgba(237, 177, 9, 0.35)",textColor:"orange",darkColor:"#ffff00",darkTextColor:"black"}}},{title:"As a link",demo:{view:e,data:{text:"Link to something",href:"#",external:!0}}},{title:"Prefix and postfix",demo:{view:e,data:{prefix:"prefix",text:"link",postfix:"postfix"}}},{title:"With a hint",demo:{view:e,data:{text:"text",hint:"hint"}}}]}); ``` -------------------------------- ### CodeMirror Document Methods: Get Range, Line, Handle Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Provides methods to retrieve text within a range, a specific line's text, or its handle. Also includes functions to get line numbers and visual start positions. ```javascript zo.prototype.getRange=function(e,t,n){var i=Ve(this,lt(this,e),lt(this,t)); return!1===n?i:""===n?i.join(""):i.join(n||this.lineSeparator())}, zo.prototype.getLine=function(e){var t=this.getLineHandle(e);return t&&t.text}, zo.prototype.getLineHandle=function(e){if(Xe(this,e))return Ye(this,e)}, zo.prototype.getLineHandleVisualStart=function(e){return"number"==typeof e&&(e=Ye(this,e)),Bt(e)}, zo.prototype.getLineNumber=function(e){return Je(e)} ``` -------------------------------- ### Get All Marks in Document Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Retrieves all markers currently present in the document that have a defined start position. Useful for inventorying all highlighted elements. ```javascript var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:"#.params.hash";return{content:[{view:"package-instance-item",data:"{\n instance,\n hash: ".concat(e,",\n match: #.filter\n }")}],children:"[\n title: \"Reasons\",\n data: instance.reasons,\n type: 'reasons'\n },{\n title: \"Modules\",\n data: instance.modules.[not shouldHideModule()],\n type: 'modules'\n }]",itemConfig:{view:"switch",content:[{when:'type="reasons"',content:{view:"tree-leaf",content:"text:title",children:"\n $reasonsWithModule:data.[type='module'].data.[$];\n [{\n title: \"Chunks\",\n reasons: $reasonsWithModule,\n children: $reasonsWithModule.[not shouldHideModule()].chunks.sort(initial desc, entry desc, size desc),\n type: 'chunk'\n }, {\n title: \"Modules\",\n children: $reasonsWithModule.[not shouldHideModule()],\n type: 'module'\n }, {\n title: \"Packages\",\n reasons: $reasonsWithModule,\n children: $reasonsWithModule.(resolvedResource.nodeModule()).name.[],\n type: 'package'\n }].[children]",itemConfig:{view:"switch",content:[{when:'type="chunk"',content:{view:"tree-leaf",content:["text:title",{when:"children",view:"badge",className:"hack-badge-margin-left",data:"{text: children.size()}"}],children:"children.({value: $, reasons: @.reasons})",itemConfig:{content:"chunk-item:{chunk: value, hash: ".concat(e,", itemConfig:{content:["text:title",{when:"children",view:"badge",className:"hack-badge-margin-left",data:"{text: children.size()}"}],children:"children",limit:"= settingListItemsLimit()",get itemConfig(){return(0,i.N)(void 0,e)}}}},{when:'type="module"',content:{view:"tree-leaf",content:["text:title",{when:"children",view:"badge",className:"hack-badge-margin-left",data:"{text: children.size()}"}],children:"children",limit:"= settingListItemsLimit()",get itemConfig(){return(0,i.N)(void 0,e)}}},{when:'type="package"',content:{view:"tree-leaf",content:["text:title",{when:"children",view:"badge",className:"hack-badge-margin-left",data:"{text: children.size()}"}],children:"\n children.(\n $child:$;\n {\n value: $child,\n reasons: @.reasons,\n instances: resolvePackage(".concat(e,").instances.({value: $, reasons: @.reasons, package: $child})\n .[\n $foo:value.path;\n reasons.(resolvedResource.nodeModule()).path has $foo\n ]\n })\n ",itemConfig:{content:["package-item:{package: value.resolvePackage(".concat(e,"), hash: ").concat(e,",\n match: #.filter\n }")],children:"\n instances.(\n $instance: $;\n {\n $instance,\n reasonModules: reasons.[not shouldHideModule() and resolvedResource.nodeModule().path=$instance.value.path]\n .sort(getModuleSize(".concat(e,").size desc)\n })",itemConfig:{content:["package-instance-item:{instance: instance.value, hash: ".concat(e,",\n match: #.filter\n }")],children:"reasonModules",limit:"= settingListItemsLimit()",get itemConfig(){return(0,i.N)("$",e)}}}}}]}}},{when:'type="modules"',content:{view:"tree-leaf",content:["text:title",{when:"data",view:"badge",className:"hack-badge-margin-left",data:"{text: data.size()}"}],children:"data",limit:"= settingListItemsLimit()",get itemConfig(){return(0,i.N)(void 0,e)}}}}]}}} ``` -------------------------------- ### Get All Scrollable Ancestors Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Recursively collects all scrollable ancestors of an element, starting from the nearest one up to the window. Used for positioning calculations. ```javascript function I(e){var t=b(k(e)).left+w(e).scrollLeft;return t} ``` -------------------------------- ### Initialize Statoscope Resolvers and Indexes Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Sets up extensions, compilation indexes, and resolvers for Statoscope. This includes registering default modules and their versions. ```javascript a={extensions:(0,g.default)((function(e){return e.data.descriptor.name}),o),compilation:{byAsset:new WeakMap,byChunks:new WeakMap,byModule:new WeakMap,byEntrypoint:new WeakMap}},s={resolveExtension:function(e){return a.extensions.get(e)},resolveCompilationByAsset:function(e){return a.compilation.byAsset.get(e)},resolveCompilationByChunk:function(e){return a.compilation.byChunks.get(e)},resolveCompilationByModule:function(e){return a.compilation.byModule.get(e)},resolveCompilationByEntrypoint:function(e){return a.compilation.byEntrypoint.get(e)}};return{file:r,compilations:(0,m.default)(e,r,{indexes:a,resolvers:s}),resolvers:s,indexes:a}} ``` -------------------------------- ### Get Base Position Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Retrieves the position of the base value on the radar chart. This is typically used for drawing reference lines or determining the starting point for certain elements. ```javascript getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())} ``` -------------------------------- ### Path Manipulation Example Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Illustrates how to handle file paths, potentially for reading or writing files. It shows a common pattern for constructing or referencing file locations. ```javascript const path = "C:\\Users\\file"; ``` -------------------------------- ### Get Radar Chart Index Angle Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Calculates the angle for a specific point label index, considering the total number of points and an optional start angle offset. Used for positioning elements around the chart. ```javascript getIndexAngle(e){return Y(e*(D/(this._pointLabels.length||1))+F(this.options.startAngle||0))} ``` -------------------------------- ### Calculate Entrypoint Sizes and Download Times Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Calculates various size and download time metrics for entrypoints, distinguishing between initial and asynchronous assets. It sorts results based on size limits and download times. ```javascript $getEntryChunksSizes: => (\n files.[not name.shouldExcludeResource()].[[].(getAssetSize($$, $useCompressedSize))\n);\n\n$addedEntrypoints: $statB.compilation.entrypoints.[\n $name: name;\n not $statA.compilation.entrypoints.[name=$name].pick()\n].({\n entry: $,\n hash: $statB.compilation.hash\n});\n$removedEntrypoints: $statA.compilation.entrypoints.[\n $name: name;\n not $statB.compilation.entrypoints.[name=$name].pick()\n].({\n entry: $,\n hash: $statA.compilation.hash\n});\n$intersectedEntrypoints: $statA.compilation.entrypoints.({\n $entryA: $;\n $entryB: $statB.compilation.entrypoints.[name=$entryA.name].pick();\n a: {entry: $entryA, hash: $statA.compilation.hash},\n b: {entry: $entryB, hash: $statB.compilation.hash},\n}).[b.entry];\n\n$entryDiff: {\n added: $addedEntrypoints\n .({\n $chunksAll: entry.data.chunks + entry.data.chunks..children;\n $chunksInitial: $chunksAll.[initial];\n $chunksAsync: $chunksAll.[not initial];\n\n $assetsAllSize: $chunksAll.$getEntryChunksSizes(hash).reduce(=> size + $$, 0);\n $assetsInitialSizes: $chunksInitial.$getEntryChunksSizes(hash);\n $assetsInitialSize: $assetsInitialSizes.reduce(=> size + $$, 0);\n $assetsAsyncSize: $chunksAsync.$getEntryChunksSizes(hash).reduce(=> size + $$, 0);\n\n $downloadTime: $assetsInitialSizes\n .reduce(=> settingAssetsInjectType() = 'sync' ? (size + $$) : (size > $$ ? size : $$), 0)\n .getDownloadTime();\n entry,\n hash,\n diff: [\n {\n id: 'initialSize',\n type: 'size',\n title: 'initial assets',\n a: 0,\n b: $assetsInitialSize\n },\n {\n type: 'time',\n title: 'initial download',\n a: 0,\n b: $downloadTime\n },\n {\n type: 'size',\n title: 'all assets',\n a: 0,\n b: $assetsAllSize\n },\n {\n type: 'size',\n title: 'async assets',\n a: 0,\n b: $assetsAsyncSize\n },\n ]\n .[a != b]\n })\n .sort(entry.isOverSizeLimit asc, diff.[id='initialSize'].pick().b desc),\n removed: $removedEntrypoints\n .({\n $chunksAll: entry.data.chunks + entry.data.chunks..children;\n $chunksInitial: $chunksAll.[initial];\n $chunksAsync: $chunksAll.[not initial];\n\n $assetsAllSize: $chunksAll.$getEntryChunksSizes(hash).reduce(=> size + $$, 0);\n $assetsInitialSizes: $chunksInitial.$getEntryChunksSizes(hash);\n $assetsInitialSize: $assetsInitialSizes.reduce(=> size + $$, 0);\n $assetsAsyncSize: $chunksAsync.$getEntryChunksSizes(hash).reduce(=> size + $$, 0);\n\n $downloadTime: $assetsInitialSizes\n .reduce(=> settingAssetsInjectType() = 'sync' ? (size + $$) : (size > $$ ? size : $$), 0)\n .getDownloadTime();\n entry,\n hash,\n diff: [\n {\n id: 'initialSize',\n type: 'size',\n title: 'initial assets',\n a: $assetsInitialSize,\n b: 0,\n },\n {\n type: 'time',\n title: 'initial download',\n a: $downloadTime,\n b: 0,\n },\n {\n type: 'size',\n title: 'all assets',\n a: $assetsAllSize,\n b: 0,\n },\n {\n type: 'size',\n title: 'async assets',\n a: $assetsAsyncSize,\n b: 0,\n },\n ]\n .[a != b]\n })\n .sort(entry.isOverSizeLimit asc, diff.[id='initialSize'].pick().b desc),\n changed: $intersectedEntrypoints\n .({\n $a: a;\n $b: b;\n \n $chunksAllA: $a.entry.data.chunks + $a.entry.data.chunks..children;\n $chunksAllB: $b.entry ``` -------------------------------- ### Install Specific or Latest NPM Module Version Source: https://github.com/ajaxy/telegram-tt/blob/master/docs/TAURI.md Install a specific version of a Tauri NPM module using `npm install @tauri-apps/{MODULE}@{VERSION}` or the latest version with `npm install @tauri-apps/{MODULE}@latest`. ```bash # Install a specific version npm install @tauri-apps/cli@{VERSION} # or install the latest version npm install @tauri-apps/cli@latest ``` -------------------------------- ### Initialize FoamTree with Data Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Initializes the FoamTree visualization with provided data and options. This is a core setup step for displaying hierarchical data. ```javascript function re(t,r,o){function a(e){var t=[];return A.L(v,(function(n){e(n)&&t.push(n.group)})),{groups:t}} function s(e,t){var n=x.options,i=n.Pi,r=n.Oi;n=n.Od;var o=0 { const exports = {}; const module = { exports }; ((module, exports) => { /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako={})}(this,(function(t){"use strict";function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,i=30,r=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),o=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Array(576);e(d);var _=new Array(60);e(_);var f=new Array(512);e(f);var u=new Array(256);e(u);var c=new Array(29);e(c);var w,m,b,g=new Array(i);function p(t,e,a,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function v(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(g);var k=function(t){return t<256?f[t]:f[256+(t>>>7)]},y=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<>>=1,a<<=1}while(--e>0);return a>>>1},E=function(t,e,a){var n,i,s=new Array(16),o=0;for(n=1;n<=r;n++)o=o+a[n-1]<<1,s[n]=o;for(i=0;i<=e;i++){var l=t[2*i+1];0!==l&&(t[2*i]=A(s[l++],l))}},R=function(t){var e;for(e=0;e8?y(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},S=function(t,e,a,n){return t[2*e]tUu(e,n(t,i))),{query:n}):n}),{version:"1.0.0-beta.8",buildin:du,methods:Eu,assertions:$u,setup:function(e){let t=new Map,n=new Map,i=new Map,r=new Map,{methods:o,assertions:a}=e||{},{queryMethods:s,queryAssertions:l}=Qu(o,a);return function(e,o){o=o||{};let a,c=Boolean(o.stat),u=Boolean(o.tolerant),d=c?u?r:n:u?i:t;if(e=String(e),d.has(e)&&!o.debug)a=d.get(e);else{let t=Ju(e,c,u,o.debug)(du,s,l);a=c?Object.assign(((n,i)=>Uu(e,t(n,i))),{query:t}):t,d.set(e,a)}return a}}}),{version:"1.0.0-beta.8",buildin:du,methods:Eu,assertions:$u,setup:function(e){let t=new Map,n=new Map,i=new Map,r=new Map,{methods:o,assertions:a}=e||{},{queryMethods:s,queryAssertions:l}=Qu(o,a);return function(e,o){o=o||{};let a,c=Boolean(o.stat),u=Boolean(o.tolerant),d=c?u?r:n:u?i:t;if(e=String(e),d.has(e)&&!o.debug)a=d.get(e);else{let t=Ju(e,c,u,o.debug)(du,s,l);a=c?Object.assign(((n,i)=>Uu(e,t(n,i))),{query:t}):t,d.set(e,a)}return a}}}) ``` -------------------------------- ### Get Label and Value Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Retrieves the label and formatted value for a specific data index. It uses the scale's methods to get user-friendly representations. ```javascript getLabelAndValue(e){ const t=this._cachedMeta, n=t.iScale, i=t.vScale, r=this.getParsed(e); return{ label:n?""+n.getLabelForValue(r[n.axis]):"", value:i?""+i.getLabelForValue(r[i.axis]):"" } } ``` -------------------------------- ### Get Scale Ticks Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Returns the array of ticks for the scale. ```javascript getTicks(){return this.ticks} ``` -------------------------------- ### Get editor history Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Retrieves the current undo and redo history stacks. ```javascript getHistory:function(){return{done:Gr(this.history.done),undone:Gr(this.history.undone)}} ``` -------------------------------- ### Initialize Discovery Nav Configuration Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Sets up the configuration for the discovery navigation, including secondary configurations, view settings, and event handlers for rendering and interaction. It also subscribes to content rectangle changes to update CSS variables. ```javascript this.config=[ this.secondary, { view: "nav-button", name: "burger", data: () => { let e = ue(); return this.host.view.render(e, this.menu, this.host.data, { ...this.context, hide: () => this.popup && this.popup.hide() }).then((() => [...e.childNodes].filter((e => 1 === e.nodeType || 3 === e.nodeType)))) }, whenData: !0, onClick: (e, n) => { this.popup || (this.popup = new this.host.view.Popup({className: "discovery-nav-popup"}), this.popup.el.addEventListener("click", (({target: e}) => { e.closest("a[href]") && setTimeout((() => this.popup.hide()), 50) }), !0)), this.popup.toggle(e, (e => e.append(...n, t))) } }, this.primary ], Object.assign(this, this.secondary), this.contentRect = new Xo, this.contentRect.subscribe((({width: t, height: n}) => { let {container: i} = e.dom; i && (i.style.setProperty("--discovery-nav-width", t + "px"), i.style.setProperty("--discovery-nav-height", n + "px")) })) ``` -------------------------------- ### Calculate Initial Asset Size Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Calculates the total size of initial assets for an entrypoint, considering compression options. ```javascript this.assets_getTotalSize(this.entrypoint_getInitialAssets(e),t,n) ``` -------------------------------- ### Get Version Information Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Retrieves the version string for the current Statoscope module. ```javascript t.version="1.0.0-beta.8" ``` -------------------------------- ### Layout Initialization and Options Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Initializes different layout algorithms (random, ordered, squarified, fisheye, blackhole) based on options. Handles layout relaxation and updates. ```JavaScript function H(e){function t(e,t,n,i){var r,o=0,a=[];for(r=0;r=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var a=Qe.inflateInit2(this.strm,e.windowBits);if(a!==aa)throw new Error(j[a]);if(this.header=new Ve,Qe.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Wt(e.dictionary):"[object ArrayBuffer]"===$e.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Qe.inflateSetDictionary(this.strm,e.dictionary))!==aa))throw new Error(j[a])} ``` -------------------------------- ### Get extending selection mode Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Returns the current state of the extending selection mode. ```javascript getExtending:function(){return this.extend} ``` -------------------------------- ### Get all selections Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Returns an array containing all current selections, optionally joined by a separator. ```javascript getSelections:function(e){for(var t=[],n=this.sel.ranges,i=0;i=0' with an empty string, simplifying ranges that start from zero. ```javascript D=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")) ``` -------------------------------- ### Transition Configuration Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html Sets up default configurations for various chart transitions, such as active state changes, resizing, and showing/hiding elements. ```javascript Je.set("transitions",{ active:{ animation:{ duration:400 } }, resize:{ animation:{ duration:0 } }, show:{ animations:{ colors:{ from:"transparent" }, visible:{ type:"boolean", duration:0 } } }, hide:{ animations:{ colors:{ to:"transparent" }, visible:{ type:"boolean", easing:"linear", fn:e=>0|e } } } }) ``` -------------------------------- ### Example Usage of a Function Source: https://github.com/ajaxy/telegram-tt/blob/master/dist/statoscope-report.html This snippet demonstrates the basic usage of a function, likely for data processing or manipulation within the project. It shows how to call the function and what parameters it might expect. ```javascript function example() { return true; } ```