massive Shape rework: keep both tvPoints/Props and ourPoints/Props; delegate model updates to subclasses; DCA/VLine working but Ladder/HLine not done.

This commit is contained in:
Tim
2024-04-16 16:25:31 -04:00
parent 8befffe1c5
commit 65be28fb0a
11 changed files with 874 additions and 208 deletions

View File

@@ -75,10 +75,10 @@
<script setup>
import {computed, onBeforeUnmount, onMounted, onUnmounted, onUpdated, watch, watchEffect} from "vue";
import {cancelDrawing, chart} from "@/charts/chart.js";
import {applyLine2, builderFuncs, useChartOrderStore} from "@/orderbuild.js";
import {applyLine2, builderDefaults, builderFuncs, useChartOrderStore} from "@/orderbuild.js";
import Color from "color";
import {HLine} from "@/charts/shape.js";
import {builderDefaults, lightenColor2, lineColor} from "@/misc.js";
import {lightenColor2, sideColor} from "@/misc.js";
import {useTheme} from "vuetify";
import {useOrderStore} from "@/store/store.js";
import RowBar from "@/components/chart/RowBar.vue";
@@ -93,15 +93,13 @@ const emit = defineEmits(['update:builder'])
function computeDefaultColor() {
const index = props.order.builders.indexOf(props.builder)
return lineColor(props.order.buy, index)
return sideColor(props.order.buy, index)
}
const defaultColor = computeDefaultColor()
// Fields must be defined in order to be reactive
builderDefaults(props, emit, {
valid: false,
allocation: 1.0,
builderDefaults(props.builder, {
start: null, // todo
end: null, // todo
priceA: null,