Skip to Content
🎉 Univer 0.6.0 is released.Read more →

Images

Facade APIHas Paid PlanUniver ServerUniver on Node.jsPreset
----UniverSheetsDrawingPreset

Insert floating images and cell images, support adjusting size and position.

This feature includes the following plugin packages:

Presets Installation

import { createUniver, defaultTheme, LocaleType, merge } from '@univerjs/presets'; import { UniverSheetsCorePreset } from '@univerjs/presets/preset-sheets-core'; import UniverPresetSheetsCoreEnUS from '@univerjs/presets/preset-sheets-core/locales/en-US'; import { UniverSheetsDrawingPreset } from '@univerjs/presets/preset-sheets-drawing'; import UniverPresetSheetsDrawingEnUS from '@univerjs/presets/preset-sheets-drawing/locales/en-US'; import '@univerjs/presets/lib/styles/preset-sheets-core.css' import '@univerjs/presets/lib/styles/preset-sheets-drawing.css' const { univerAPI } = createUniver({ locale: LocaleType.EN_US, locales: { [LocaleType.EN_US]: merge( {}, UniverPresetSheetsCoreEnUS, UniverPresetSheetsDrawingEnUS ), }, theme: defaultTheme, presets: [ UniverSheetsCorePreset(), UniverSheetsDrawingPreset() ] });

Piecemeal Installation

npm install @univerjs/docs-drawing @univerjs/drawing @univerjs/drawing-ui @univerjs/sheets-drawing @univerjs/sheets-drawing-ui
import { LocaleType, merge, Univer } from '@univerjs/core'; import { defaultTheme } from "@univerjs/design"; import { UniverDocsDrawingPlugin } from '@univerjs/docs-drawing'; import { IImageIoService, UniverDrawingPlugin } from '@univerjs/drawing'; import { UniverDrawingUIPlugin } from '@univerjs/drawing-ui'; import { UniverSheetsDrawingPlugin } from '@univerjs/sheets-drawing'; import { UniverSheetsDrawingUIPlugin } from '@univerjs/sheets-drawing-ui'; import DrawingUIEnUS from '@univerjs/drawing-ui/locale/en-US'; import SheetsDrawingUIEnUS from '@univerjs/sheets-drawing-ui/locale/en-US'; import '@univerjs/drawing-ui/lib/index.css'; import '@univerjs/sheets-drawing-ui/lib/index.css'; const univer = new Univer({ theme: defaultTheme, locale: LocaleType.EN_US, locales: { [LocaleType.EN_US]: merge( DrawingUIEnUS, SheetsDrawingUIEnUS, ), }, }); // When not using the collaborative plugin, the registration code is as follows: univer.registerPlugin(UniverDrawingPlugin); univer.registerPlugin(UniverDrawingUIPlugin); univer.registerPlugin(UniverSheetsDrawingPlugin); univer.registerPlugin(UniverSheetsDrawingUIPlugin); // When using the collaborative plugin, the registration code is as follows: univer.registerPlugin(UniverDrawingPlugin, { override: [[IImageIoService, null]], // The collaborative plugin will provide this implementation });

Was this page helpful?
Last updated on