當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript d3.scaleSequential函數代碼示例

本文整理匯總了TypeScript中d3.scaleSequential函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript scaleSequential函數的具體用法?TypeScript scaleSequential怎麽用?TypeScript scaleSequential使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了scaleSequential函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getColorScale

export function getColorScale(colorScheme: any, lightTheme: boolean, maxValue: number, minValue = 0): (d: any) => any {
  let colorInterpolator = d3ScaleChromatic[colorScheme.value];
  let colorScaleInverted = colorScheme.invert === 'always' || (colorScheme.invert === 'dark' && !lightTheme);

  let start = colorScaleInverted ? maxValue : minValue;
  let end = colorScaleInverted ? minValue : maxValue;

  return d3.scaleSequential(colorInterpolator).domain([start, end]);
}
開發者ID:GPegel,項目名稱:grafana,代碼行數:9,代碼來源:color_scale.ts

示例2: getColorScale

function getColorScale(colorScheme, maxValue, minValue = 0) {
  let colorInterpolator = d3[colorScheme.value];
  let colorScaleInverted = colorScheme.invert === 'always' ||
    (colorScheme.invert === 'dark' && !contextSrv.user.lightTheme);

  let start = colorScaleInverted ? maxValue : minValue;
  let end = colorScaleInverted ? minValue : maxValue;

  return d3.scaleSequential(colorInterpolator).domain([start, end]);
}
開發者ID:shirish87,項目名稱:grafana,代碼行數:10,代碼來源:color_legend.ts

示例3: getColorScale

  function getColorScale(maxValue) {
    let colorScheme = _.find(ctrl.colorSchemes, {value: panel.color.colorScheme});
    let colorInterpolator = d3[colorScheme.value];
    let colorScaleInverted = colorScheme.invert === 'always' ||
      (colorScheme.invert === 'dark' && !contextSrv.user.lightTheme);

    let start = colorScaleInverted ? maxValue : 0;
    let end = colorScaleInverted ? 0 : maxValue;

    return d3.scaleSequential(colorInterpolator).domain([start, end]);
  }
開發者ID:postsql,項目名稱:grafana,代碼行數:11,代碼來源:rendering.ts

示例4: sequentialGreenBrownCbInterpolated

export function sequentialGreenBrownCbInterpolated() {
    return scaleSequential(interpolateRgbBasis(paletteSequentialGreenBrownCb));
}
開發者ID:proteus-h2020,項目名稱:proteus-charts,代碼行數:3,代碼來源:colors.ts

示例5: sequentialVioletCbInterpolated

export function sequentialVioletCbInterpolated() {
    return scaleSequential(interpolateRgbBasis(paletteSequentialVioletCb));
}
開發者ID:proteus-h2020,項目名稱:proteus-charts,代碼行數:3,代碼來源:colors.ts

示例6: sequentialBrownInterpolated

export function sequentialBrownInterpolated() {
    return scaleSequential(interpolateRgbBasis(paletteSequentialBrown));
}
開發者ID:proteus-h2020,項目名稱:proteus-charts,代碼行數:3,代碼來源:colors.ts

示例7: sequentialLightGreenInterpolated

export function sequentialLightGreenInterpolated() {
    return scaleSequential(interpolateRgbBasis(paletteSequentialLightGreen));
}
開發者ID:proteus-h2020,項目名稱:proteus-charts,代碼行數:3,代碼來源:colors.ts

示例8: sequentialTurquoiseInterpolated

export function sequentialTurquoiseInterpolated() {
    return scaleSequential(interpolateRgbBasis(paletteSequentialTurquoise));
}
開發者ID:proteus-h2020,項目名稱:proteus-charts,代碼行數:3,代碼來源:colors.ts

示例9: sequentialPurpleInterpolated

export function sequentialPurpleInterpolated() {
    return scaleSequential(interpolateRgbBasis(paletteSequentialPurple));
}
開發者ID:proteus-h2020,項目名稱:proteus-charts,代碼行數:3,代碼來源:colors.ts


注:本文中的d3.scaleSequential函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。