org.fujion.plotly.layout.ImageOptions Maven / Gradle / Ivy
/*
* #%L
* fujion
* %%
* Copyright (C) 2021 Fujion Framework
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* #L%
*/
package org.fujion.plotly.layout;
import org.fujion.ancillary.Options;
import org.fujion.annotation.Option;
import org.fujion.plotly.common.HorizontalAlignEnum;
import org.fujion.plotly.common.VerticalAlignEnum;
/**
* Layout options for images.
*/
public class ImageOptions extends Options {
/**
* Specifies which dimension of the image to constrain.
*/
public enum SizingEnum {
CONTAIN, FILL, STRETCH;
@Override
public String toString() {
return name().toLowerCase();
}
}
/**
* Specifies whether images are drawn below or above traces. When "xref" and "yref" are both set
* to "paper", image is drawn below the entire plot area.
*
* Default: ABOVE
*/
@Option
public LayerEnum layer;
/**
* The opacity of the image.
*
* Constraints: ≥0 and ≤1
*
* Default: 1
*/
@Option
public Double opacity;
/**
* The image container size horizontally. The image will be sized based on the "position" value.
* When "xref" is set to "paper", units are sized relative to the plot width.
*
* Default: 0
*/
@Option
public Integer sizex;
/**
* The image container size vertically. The image will be sized based on the "position" value.
* When "yref" is set to "paper", units are sized relative to the plot height.
*
* Default: 0
*/
@Option
public Integer sizey;
/**
* Specifies which dimension of the image to constrain.
*/
@Option
public SizingEnum sizing;
/**
* Specifies the URL of the image to be used. The URL must be accessible from the domain where
* the plot code is run, and can be either relative or absolute.
*/
@Option
public String source;
/**
* Determines whether or not this image is visible.
*
* Default: true
*/
@Option
public Boolean visible;
/**
* The image's x position. When "xref" is set to "paper", units are sized relative to the plot
* height. See "xref" for more info.
*
* Default: 0
*/
@Option
public Double x;
/**
* The anchor for the x position.
*
* Default: LEFT
*/
@Option
public HorizontalAlignEnum xanchor;
/**
* The images's x coordinate axis. If set to a x axis id (e.g. "x" or "x2"), the "x" position
* refers to an x data coordinate If set to "paper", the "x" position refers to the distance
* from the left of plot in normalized coordinates where "0" ("1") corresponds to the left
* (right).
*
* Constraints: "paper" | "/^x([2-9]|[1-9][0-9]+)?$/"
*
* Default: "paper"
*/
@Option
public String xref;
/**
* The image's y position. When "yref" is set to "paper", units are sized relative to the plot
* width. See "yref" for more info.
*
* Default: 0
*/
@Option
public Double y;
/**
* The anchor for the y position.
*
* Default: TOP
*/
@Option
public VerticalAlignEnum yanchor;
/**
* The images's y coordinate axis. If set to a y axis id (e.g. "y" or "y2"), the "y" position
* refers to a y data coordinate. If set to "paper", the "y" position refers to the distance
* from the bottom of the plot in normalized coordinates where "0" ("1") corresponds to the
* bottom (top).
*
* Constraints: "paper" | "/^x([2-9]|[1-9][0-9]+)?$/"
*
* Default: "paper"
*/
@Option
public String yref;
}