@trdrs/quickcharts 1.0.0 → 1.1.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.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @trdrs/quickcharts
2
2
 
3
+ ## 1.1.0
4
+
5
+ The symbol search can name what it is limited to, with a host-painted mark, beside the asset-class filters (`search.scope`, `SearchScope`).
6
+
7
+ ## 1.0.1
8
+
9
+ Emoji drawings and the picker use bundled Twemoji artwork without a host asset server.
10
+ Hosts may supply an image intake port while keeping the bundled emoji artwork.
11
+
3
12
  ## 1.0.0
4
13
 
5
14
  - A complete browser chart over host-supplied market data and storage, with seven chart styles,
package/README.md CHANGED
@@ -1280,18 +1280,25 @@ in `ui`; hiding one removes the control and leaves its commands.
1280
1280
  ```ts
1281
1281
  import { createChart, createUdfDatafeed } from '@trdrs/quickcharts'
1282
1282
 
1283
+ declare const portfolio: { name: string } | null
1284
+
1283
1285
  const trimmed = createChart({
1284
1286
  container,
1285
1287
  datafeed: createUdfDatafeed({ baseUrl: 'https://feed.example.com/udf' }),
1286
1288
  ui: { navigation: false, topBar: { layouts: false, image: false } },
1287
- search: { classNames: { future: 'Futures', crypto: 'Crypto' } },
1289
+ search: {
1290
+ classNames: { future: 'Futures', crypto: 'Crypto' },
1291
+ scope: () => (portfolio ? { label: portfolio.name } : null),
1292
+ },
1288
1293
  preferences: { savedTimeframes: ['1m', '15m', '1h', '1d'], layoutAutosave: true },
1289
1294
  })
1290
1295
  trimmed.on('saveNeeded', () => note('the layout has unsaved changes'))
1291
1296
  ```
1292
1297
 
1293
1298
  The search dialog's class chips come from your datafeed's `config().classes`, named through
1294
- `search.classNames`; a class you do not name wears its token. The range presets read your
1299
+ `search.classNames`; a class you do not name wears its token. `search.scope` names what your
1300
+ search is limited to at the far edge of that strip, with the mark its `mark` paints; your datafeed
1301
+ decides what is found. The range presets read your
1295
1302
  datafeed's optional `earliestBar(symbol)`: a preset deeper than the history you serve is disabled.
1296
1303
 
1297
1304
  ```ts
@@ -2062,8 +2069,9 @@ adapter they last the page.
2062
2069
  The image and glyph tools reach your host through `ChartWidgetOptions.assets`. `intakeImage`
2063
2070
  turns a picked file into a payload within the caps and answers a refusal as a code the chart
2064
2071
  resolves through its own catalog; `glyphSource` answers the artwork URL an emoji or sticker draws
2065
- with, or null to draw the glyph as text. Without the port the image tool does not open and glyphs
2066
- draw as text.
2072
+ with, or null to draw the glyph as text. Emoji artwork from Twemoji is bundled and works without
2073
+ an asset port or external requests. Omit `glyphSource` to use it. Without the port the image tool
2074
+ does not open. Keep the Twemoji credit in `THIRD-PARTY-NOTICES.md` accessible in your product.
2067
2075
 
2068
2076
  The layer is also mountable on its own lightweight-charts pair, without the widget:
2069
2077
 
@@ -2136,7 +2144,8 @@ const assets: DrawingAssetPort = {
2136
2144
  const { width, height } = fittedSize(1200, 900)
2137
2145
  return { ok: true, asset: { dataUrl: await myBackend.read(file), width, height, downscaled: false } }
2138
2146
  },
2139
- glyphSource: (glyph) => myBackend.emojiUrl(glyph),
2147
+ // Optional: glyphSource replaces the bundled emoji artwork.
2148
+ // glyphSource: (glyph) => myBackend.emojiUrl(glyph),
2140
2149
  }
2141
2150
  note(IMAGE_ACCEPT)
2142
2151
  ```
@@ -4,6 +4,10 @@ This document lists every third-party package in the dependency closure of `@trd
4
4
 
5
5
  `@trdrs/quickcharts` bundles no third-party code. It declares one peer dependency that your application installs and bundles, and that peer installs one package of its own. Because your application bundle redistributes these packages, their license conditions attach to your product; this document tells you what each one asks for.
6
6
 
7
+ ### Bundled Twemoji artwork
8
+
9
+ The emoji SVG graphics are from [Twemoji](https://github.com/jdecked/twemoji), copyright Twitter, Inc and other contributors, licensed under [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/). The graphics are combined into an internal artwork table; SVG identifiers are namespaced per glyph. Keep this credit and the license link accessible to users of your product. The graphics license is separate from the Apache-2.0 license of the library code.
10
+
7
11
  | Package | Version | License | Reached through |
8
12
  |---|---|---|---|
9
13
  | `fancy-canvas` | 2.1.0 | MIT | `lightweight-charts@5.2.0` |
@@ -1427,10 +1427,10 @@ interface DrawingAssetPort {
1427
1427
  * used. The host owns the decode and the resample; `checkImageFile` and `fitScale` below are the
1428
1428
  * library's rules it applies. */
1429
1429
  intakeImage(file: File): Promise<ImageIntakeResult>;
1430
- /** Artwork for one emoji or sticker glyph, as a URL the canvas can draw, or null to fall back to
1430
+ /** Optional replacement for the bundled Twemoji artwork. Artwork for one emoji or sticker glyph, as a URL the canvas can draw, or null to fall back to
1431
1431
  * drawing the glyph as text. Icon marks always stay text: their ink is tinted by the stroke
1432
1432
  * color, which artwork cannot carry. */
1433
- glyphSource(glyph: string): string | null;
1433
+ glyphSource?(glyph: string): string | null;
1434
1434
  }
1435
1435
  /** Type and size gate, pure so it needs no DOM and no real file. */
1436
1436
  declare function checkImageFile(file: {
@@ -6956,4 +6956,4 @@ export {
6956
6956
  NO_DASH,
6957
6957
  INPUT_PROPS
6958
6958
  };
6959
- //# sourceMappingURL=chunk-PD3DEWMQ.js.map
6959
+ //# sourceMappingURL=chunk-RDAK5MUM.js.map