# packages/core/src/features/viz/lib/log-scale-component.ts
This is the source snapshot used to build these API details. [View this revision on GitHub](https://github.com/benlesh/pibbl/blob/272a94aaf62e0bd6ad8726a4c607a76a9ec44ca1/packages/core/src/features/viz/lib/log-scale-component.ts#L10).

[Back to reference](/reference/components/log-scale/)

<pre class="api-source"><code><span id="L1"><a href="#L1" aria-label="Line 1">1</a> import { resolveSignalValue, useLayoutBox } from &quot;@pibbl/core&quot;;</span>
<span id="L2"><a href="#L2" aria-label="Line 2">2</a> import type { LogScaleProps } from &quot;./types.js&quot;;</span>
<span id="L3"><a href="#L3" aria-label="Line 3">3</a> import { resolveLogScale } from &quot;./log-scale.js&quot;;</span>
<span id="L4"><a href="#L4" aria-label="Line 4">4</a> import { useScaleProvider } from &quot;./scale-provider.js&quot;;</span>
<span id="L5"><a href="#L5" aria-label="Line 5">5</a> /**</span>
<span id="L6"><a href="#L6" aria-label="Line 6">6</a>  * Provides a named positive logarithmic mapping to descendant marks and axes.</span>
<span id="L7"><a href="#L7" aria-label="Line 7">7</a>  * @param props - Identity, positive domain, range, and optional tick base. See {@link LogScaleProps}.</span>
<span id="L8"><a href="#L8" aria-label="Line 8">8</a>  * @returns Descendant content within the logarithmic scale scope.</span>
<span id="L9"><a href="#L9" aria-label="Line 9">9</a>  */</span>
<span id="L10"><a href="#L10" aria-label="Line 10">10</a> export function LogScale(props: LogScaleProps) {</span>
<span id="L11"><a href="#L11" aria-label="Line 11">11</a>   const { width, height } = useLayoutBox();</span>
<span id="L12"><a href="#L12" aria-label="Line 12">12</a>   useScaleProvider(props.id, &quot;log&quot;, () =&gt; resolveLogScale(</span>
<span id="L13"><a href="#L13" aria-label="Line 13">13</a>     resolveSignalValue(props.domain), resolveSignalValue(props.range),</span>
<span id="L14"><a href="#L14" aria-label="Line 14">14</a>     resolveSignalValue(props.reverse ?? false), width, height, resolveSignalValue(props.base ?? 10),</span>
<span id="L15"><a href="#L15" aria-label="Line 15">15</a>   ), [props.domain, props.range, props.reverse, props.base, width, height]);</span>
<span id="L16"><a href="#L16" aria-label="Line 16">16</a>   return props.children;</span>
<span id="L17"><a href="#L17" aria-label="Line 17">17</a> }</span>
<span id="L18"><a href="#L18" aria-label="Line 18">18</a> </span></code></pre>

## Documentation version

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.
