Skip to content

Commit 5c5ca10

Browse files
Move autoRescale to the elements object
1 parent 279449f commit 5c5ca10

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

docs/documentation.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ The main function of mathics-threejs-backend is `drawGraphics3d`, takes the foll
4848
- `protocol` (type: string) — protocol version (current is `1.2`), if it isn't compatible a warning is shown instead of the graphics. Only availiable in production version
4949
- `maxSize` (type: number) — default: `400`
5050
- `innerWidthMultiplier` (type: number) — the multiplier of the window inner width, the effective width is `min(maxSize, innerWidthMultiplier * window.innerWidth)`, default: `0.65`
51-
- `config` (type: object) — object with the following properties:
52-
- `autoRescale` (type: bool) — default: `true`
5351

5452
## Examples
5553
- ```js

src/graphics3d.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ export default function (
1919
container,
2020
{
2121
axes = {},
22+
autoRescale = true,
2223
extent,
2324
elements = [],
2425
lighting = [],
2526
viewpoint = [1.3, -2.4, 2]
2627
},
2728
maxSize = 400,
28-
innerWidthMultiplier = 0.65,
29-
{ autoRescale = true } = { autoRescale: true }
29+
innerWidthMultiplier = 0.65
3030
) {
3131
axes.hasaxes ??= false;
3232
extent ??= calculateExtent(elements);

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import drawGraphics3d from './graphics3d.js';
22

3-
function translationLayer(container, object, maxSize, innerWidthMultiplier, config) {
3+
function translationLayer(container, object, maxSize, innerWidthMultiplier) {
44
if (object.protocol) {
55
// protocol version is X.Y, so it is an array of two elements: major version and minor version
66
const versionArray = object.protocol.match(/\d/g);
@@ -38,7 +38,7 @@ function translationLayer(container, object, maxSize, innerWidthMultiplier, conf
3838
light.type = light.type.toLowerCase();
3939
});
4040

41-
return drawGraphics3d(container, object, maxSize, innerWidthMultiplier, config);
41+
return drawGraphics3d(container, object, maxSize, innerWidthMultiplier);
4242
}
4343

4444
window.drawGraphics3d = translationLayer;

0 commit comments

Comments
 (0)