Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] charts: limit trending line degree range #5022

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anhe-odoo
Copy link
Contributor

Task Description

This task aims to add a maximum value for the trending line degree (for a polynomial model), fixed to the minimum value of 10 and 1 below of the number of point in the series.

Related Task

  • Task: 4207820

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

@robodoo
Copy link
Collaborator

robodoo commented Sep 24, 2024

Pull request status dashboard

Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tchou tchou 🚂

@@ -2,6 +2,7 @@ import { Component, useState } from "@odoo/owl";
import { getColorsPalette, getNthColor, setColorAlpha, toHex } from "../../../../helpers";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: in commit message

fixed to the minimum value between 10 and 1 below the number of

Comment on lines +211 to +214
const maxOrder = this.getMaxPolynomialDegree();
if (order > maxOrder) {
element.value = `${this.getTrendLineConfiguration()?.order ?? maxOrder}`;
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait so we change the value of the input, but do not call updateTrendLineValue ? Won't we have a mismatch between the chart and the input ? (same for if (order < 2))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, as it doesn't update the chart, and it put back the original value (if existing, which is almost always the case)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah we try to use this.getTrendLineConfiguration()?.order (which I'm gressing is from the chart definition).

Still, shouldn't we set the max/min value instead of going back to the old value ? If I write degree 40 in my input i'd expect the polynomial go go to the max degree rather that goign back to 2. Or maybe it's just me ?

Task Description

This task aims to add a maximum value for the trending line degree
(for a polynomial model), fixed to the minimum value between 10
and 1 below the number of points in the series.

Related Task

Task: 4207820
@anhe-odoo anhe-odoo force-pushed the master-chart-fix_trending_line_degree-anhe branch from e7e7675 to dd2616f Compare September 27, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants