<commit_before>import * as d3 from 'd3'
import { formatType, handleErrors } from '../common/utils'

import {
  Looker,
  VisualizationDefinition,
  VisData
} from '../types/types'

// Global values provided via the API
declare var looker: Looker

type Formatter = ((s: any) => string)

const defaultFormatter: Formatter = (x) => x.toString()

interface ChordVisualization extends VisualizationDefinition {
  svg?: any,
  tooltip?: any,
  computeMatrix: (data: VisData, dimensions: string[], measure: string) => any,
  titleText: (lookup: d3.Map<string>, source: any, target: any, formatter: Formatter) => string,
}<commit_msg>added Matrix interface, updated sigs<commit_after>import * as d3 from 'd3'
import { formatType, handleErrors } from '../common/utils'

import {
  Looker,
  VisualizationDefinition,
  VisData
} from '../types/types'

// Global values provided via the API
declare var looker: Looker

type Formatter = ((s: any) => string)

const defaultFormatter: Formatter = (x) => x.toString()

interface Matrix {
  matrix: any[],
  indexByName: d3.Map<string>,
  nameByIndex: d3.Map<number>,
}

interface ChordVisualization extends VisualizationDefinition {
  svg?: any,
  tooltip?: any,
  computeMatrix: (data: VisData, dimensions: string[], measure: string) => Matrix,
  titleText: (lookup: d3.Map<number>, source: any, target: any, formatter: Formatter) => string,
}
{'fraction_non_alphanumeric': 0.1312545322697607, 'fraction_numerical': 0.005801305293691081, 'mean_word_length': 4.8474576271186445, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7192251', 'n_tokens_mistral': 427, 'n_tokens_neox': 423, 'n_words': 136}